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 | awscc.paymentcryptography.keys |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
derive_key_usage | string | |
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. |
| Name | Datatype | Description |
|---|---|---|
key_identifier | string | |
region | string | AWS region. |
For more information, see AWS::PaymentCryptography::Key.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | keys | INSERT | Exportable, KeyAttributes, region |
delete_resource | keys | DELETE | Identifier, region |
update_resource | keys | UPDATE | Identifier, PatchDocument, region |
list_resources | keys_list_only | SELECT | region |
get_resource | keys | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual key.
SELECT
region,
derive_key_usage,
enabled,
exportable,
key_attributes,
key_check_value_algorithm,
key_identifier,
key_origin,
key_state,
tags
FROM awscc.paymentcryptography.keys
WHERE
region = '{{ region }}' AND
Identifier = '{{ key_identifier }}';
Lists all keys in a region.
SELECT
region,
key_identifier
FROM awscc.paymentcryptography.keys_list_only
WHERE
region = '{{ region }}';
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 awscc.paymentcryptography.keys (
Exportable,
KeyAttributes,
region
)
SELECT
'{{ exportable }}',
'{{ key_attributes }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.paymentcryptography.keys (
DeriveKeyUsage,
Enabled,
Exportable,
KeyAttributes,
KeyCheckValueAlgorithm,
Tags,
region
)
SELECT
'{{ derive_key_usage }}',
'{{ enabled }}',
'{{ exportable }}',
'{{ key_attributes }}',
'{{ key_check_value_algorithm }}',
'{{ tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: key
props:
- name: derive_key_usage
value: '{{ derive_key_usage }}'
- name: enabled
value: '{{ enabled }}'
- name: exportable
value: '{{ exportable }}'
- name: key_attributes
value:
key_usage: '{{ key_usage }}'
key_class: '{{ key_class }}'
key_algorithm: '{{ key_algorithm }}'
key_modes_of_use:
encrypt: '{{ encrypt }}'
decrypt: '{{ decrypt }}'
wrap: '{{ wrap }}'
unwrap: '{{ unwrap }}'
generate: '{{ generate }}'
sign: '{{ sign }}'
verify: '{{ verify }}'
derive_key: '{{ derive_key }}'
no_restrictions: '{{ no_restrictions }}'
- name: key_check_value_algorithm
value: '{{ key_check_value_algorithm }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a key resource, using stack-deploy.
/*+ update */
UPDATE awscc.paymentcryptography.keys
SET PatchDocument = string('{{ {
"DeriveKeyUsage": derive_key_usage,
"Enabled": enabled,
"Exportable": exportable,
"KeyAttributes": key_attributes,
"KeyCheckValueAlgorithm": key_check_value_algorithm,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ key_identifier }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.paymentcryptography.keys
WHERE
Identifier = '{{ key_identifier }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the keys resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
payment-cryptography:GetKey,
payment-cryptography:CreateKey,
payment-cryptography:TagResource
payment-cryptography:GetKey,
payment-cryptography:ListTagsForResource
payment-cryptography:GetKey,
payment-cryptography:ListTagsForResource,
payment-cryptography:TagResource,
payment-cryptography:UntagResource,
payment-cryptography:StartKeyUsage,
payment-cryptography:StopKeyUsage
payment-cryptography:GetKey,
payment-cryptography:DeleteKey
payment-cryptography:ListKeys