Skip to main content

keys

Creates, updates, deletes or gets a key resource or lists keys in a region

Overview

Namekeys
TypeResource
DescriptionDefinition of AWS::PaymentCryptography::Key Resource Type
Idawscc.paymentcryptography.keys

Fields

NameDatatypeDescription
derive_key_usagestring
enabledboolean
exportableboolean
key_attributesobject
key_check_value_algorithmstring
key_identifierstring
key_originstringDefines the source of a key
key_statestringDefines the state of a key
tagsarray
regionstringAWS region.

For more information, see AWS::PaymentCryptography::Key.

Methods

NameResourceAccessible byRequired Params
create_resourcekeysINSERTExportable, KeyAttributes, region
delete_resourcekeysDELETEIdentifier, region
update_resourcekeysUPDATEIdentifier, PatchDocument, region
list_resourceskeys_list_onlySELECTregion
get_resourcekeysSELECTIdentifier, region

SELECT examples

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 }}';

INSERT example

Use the following StackQL query and manifest file to create a new key resource, using stack-deploy.

/*+ 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
;

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:

ParameterDescription
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:

payment-cryptography:GetKey,
payment-cryptography:CreateKey,
payment-cryptography:TagResource