keys
Creates, updates, deletes or gets a key
resource or lists keys
in a region
Overview
Name | keys |
Type | Resource |
Description | Definition of AWS::PaymentCryptography::Key Resource Type |
Id | aws.paymentcryptography.keys |
Fields
Name | Datatype | Description |
---|---|---|
enabled | boolean | |
exportable | boolean | |
key_attributes | object | |
key_check_value_algorithm | string | |
key_identifier | string | |
key_origin | string | Defines the source of a key |
key_state | string | Defines the state of a key |
tags | array | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | Exportable, KeyAttributes, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all keys
in a region.
SELECT
region,
enabled,
exportable,
key_attributes,
key_check_value_algorithm,
key_identifier,
key_origin,
key_state,
tags
FROM aws.paymentcryptography.keys
WHERE region = 'us-east-1';
Gets all properties from an individual key
.
SELECT
region,
enabled,
exportable,
key_attributes,
key_check_value_algorithm,
key_identifier,
key_origin,
key_state,
tags
FROM aws.paymentcryptography.keys
WHERE region = 'us-east-1' AND data__Identifier = '<KeyIdentifier>';
INSERT
example
Use the following StackQL query and manifest file to create a new key
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.paymentcryptography.keys (
Exportable,
KeyAttributes,
region
)
SELECT
'{{ Exportable }}',
'{{ KeyAttributes }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.paymentcryptography.keys (
Enabled,
Exportable,
KeyAttributes,
KeyCheckValueAlgorithm,
Tags,
region
)
SELECT
'{{ Enabled }}',
'{{ Exportable }}',
'{{ KeyAttributes }}',
'{{ KeyCheckValueAlgorithm }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: key
props:
- name: Enabled
value: '{{ Enabled }}'
- name: Exportable
value: '{{ Exportable }}'
- name: KeyAttributes
value:
KeyUsage: '{{ KeyUsage }}'
KeyClass: '{{ KeyClass }}'
KeyAlgorithm: '{{ KeyAlgorithm }}'
KeyModesOfUse:
Encrypt: '{{ Encrypt }}'
Decrypt: '{{ Decrypt }}'
Wrap: '{{ Wrap }}'
Unwrap: '{{ Unwrap }}'
Generate: '{{ Generate }}'
Sign: '{{ Sign }}'
Verify: '{{ Verify }}'
DeriveKey: '{{ DeriveKey }}'
NoRestrictions: '{{ NoRestrictions }}'
- name: KeyCheckValueAlgorithm
value: '{{ KeyCheckValueAlgorithm }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.paymentcryptography.keys
WHERE data__Identifier = '<KeyIdentifier>'
AND region = 'us-east-1';
Permissions
To operate on the keys
resource, the following permissions are required:
Create
payment-cryptography:GetKey,
payment-cryptography:CreateKey,
payment-cryptography:TagResource
Read
payment-cryptography:GetKey,
payment-cryptography:ListTagsForResource
Update
payment-cryptography:GetKey,
payment-cryptography:ListTagsForResource,
payment-cryptography:TagResource,
payment-cryptography:UntagResource,
payment-cryptography:StartKeyUsage,
payment-cryptography:StopKeyUsage
Delete
payment-cryptography:GetKey,
payment-cryptography:DeleteKey
List
payment-cryptography:ListKeys