Skip to main content

resource_policies

Creates, updates, deletes, gets or lists a resource_policies resource.

Overview

Nameresource_policies
TypeResource
Idaws.payment_cryptography.resource_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
policystringThe resource-based policy attached to the key, in JSON format. (pattern: <code>[\u0009\u000A\u000D\u0020-\u00FF]+</code>)
resource_arnstringThe KeyARN of the key. (pattern: <code>arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:key/[0-9a-zA-Z]{16,64}</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_resource_policyselectregionReturns the resource-based policy attached to an Amazon Web Services Payment Cryptography key. Cross-account use: This operation can't be used across different Amazon Web Services accounts. Related operations: PutResourcePolicy DeleteResourcePolicy
put_resource_policyreplaceregion, ResourceArnAttaches or replaces a resource-based policy on an Amazon Web Services Payment Cryptography key. A resource-based policy can grant cross-account access to your key. If the policy would grant public access, the request fails with a PublicPolicyException. To remove a resource-based policy from a key, use DeleteResourcePolicy. Cross-account use: This operation can't be used across different Amazon Web Services accounts. Related operations: GetResourcePolicy DeleteResourcePolicy
delete_resource_policydeleteregionRemoves the resource-based policy attached to an Amazon Web Services Payment Cryptography key. Cross-account use: This operation can't be used across different Amazon Web Services accounts. Related operations: PutResourcePolicy GetResourcePolicy

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Returns the resource-based policy attached to an Amazon Web Services Payment Cryptography key. Cross-account use: This operation can't be used across different Amazon Web Services accounts. Related operations: PutResourcePolicy DeleteResourcePolicy

SELECT
policy,
resource_arn
FROM aws.payment_cryptography.resource_policies
WHERE region = '{{ region }}' -- required
;

REPLACE examples

Attaches or replaces a resource-based policy on an Amazon Web Services Payment Cryptography key. A resource-based policy can grant cross-account access to your key. If the policy would grant public access, the request fails with a PublicPolicyException. To remove a resource-based policy from a key, use DeleteResourcePolicy. Cross-account use: This operation can't be used across different Amazon Web Services accounts. Related operations: GetResourcePolicy DeleteResourcePolicy

REPLACE aws.payment_cryptography.resource_policies
SET
ResourceArn = '{{ ResourceArn }}',
Policy = '{{ Policy }}'
WHERE
region = '{{ region }}' --required
AND ResourceArn = '{{ ResourceArn }}' --required
RETURNING
policy,
resource_arn;

DELETE examples

Removes the resource-based policy attached to an Amazon Web Services Payment Cryptography key. Cross-account use: This operation can't be used across different Amazon Web Services accounts. Related operations: PutResourcePolicy GetResourcePolicy

DELETE FROM aws.payment_cryptography.resource_policies
WHERE region = '{{ region }}' --required
;