resource_policies
Creates, updates, deletes, gets or lists a resource_policies resource.
Overview
| Name | resource_policies |
| Type | Resource |
| Id | aws.comprehend.resource_policies |
Fields
The following fields are returned by SELECT queries:
- describe_resource_policy
| Name | Datatype | Description |
|---|---|---|
creation_time | string (date-time) | The time at which the policy was created. |
last_modified_time | string (date-time) | The time at which the policy was last modified. |
policy_revision_id | string | The revision ID of the policy. Each time you modify a policy, Amazon Comprehend assigns a new revision ID, and it deletes the prior version of the policy. (pattern: <code>[0-9A-Fa-f]+</code>) |
resource_policy | string | The JSON body of the resource-based policy. (pattern: <code>[\u0009\u000A\u000D\u0020-\u00FF]+</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_resource_policy | select | region | Gets the details of a resource-based policy that is attached to a custom model, including the JSON body of the policy. | |
put_resource_policy | replace | region, ResourceArn, ResourcePolicy | Attaches a resource-based policy to a custom model. You can use this policy to authorize an entity in another Amazon Web Services account to import the custom model, which replicates it in Amazon Comprehend in their account. | |
delete_resource_policy | delete | region | Deletes a resource-based policy that is attached to a custom model. |
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
- describe_resource_policy
Gets the details of a resource-based policy that is attached to a custom model, including the JSON body of the policy.
SELECT
creation_time,
last_modified_time,
policy_revision_id,
resource_policy
FROM aws.comprehend.resource_policies
WHERE region = '{{ region }}' -- required
;
REPLACE examples
- put_resource_policy
Attaches a resource-based policy to a custom model. You can use this policy to authorize an entity in another Amazon Web Services account to import the custom model, which replicates it in Amazon Comprehend in their account.
REPLACE aws.comprehend.resource_policies
SET
ResourceArn = '{{ ResourceArn }}',
ResourcePolicy = '{{ ResourcePolicy }}',
PolicyRevisionId = '{{ PolicyRevisionId }}'
WHERE
region = '{{ region }}' --required
AND ResourceArn = '{{ ResourceArn }}' --required
AND ResourcePolicy = '{{ ResourcePolicy }}' --required
RETURNING
policy_revision_id;
DELETE examples
- delete_resource_policy
Deletes a resource-based policy that is attached to a custom model.
DELETE FROM aws.comprehend.resource_policies
WHERE region = '{{ region }}' --required
;