resource_policies
Creates, updates, deletes, gets or lists a resource_policies resource.
Overview
| Name | resource_policies |
| Type | Resource |
| Id | aws.payment_cryptography.resource_policies |
Fields
The following fields are returned by SELECT queries:
- get_resource_policy
| Name | Datatype | Description |
|---|---|---|
policy | string | The resource-based policy attached to the key, in JSON format. (pattern: <code>[\u0009\u000A\u000D\u0020-\u00FF]+</code>) |
resource_arn | string | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_resource_policy | select | region | 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 | |
put_resource_policy | replace | region, ResourceArn | 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 | |
delete_resource_policy | delete | region | 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 |
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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_resource_policy
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
- put_resource_policy
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
- delete_resource_policy
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
;