Skip to main content

resource_policies

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

Overview

Nameresource_policies
TypeResource
Idaws.comprehend.resource_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
creation_timestring (date-time)The time at which the policy was created.
last_modified_timestring (date-time)The time at which the policy was last modified.
policy_revision_idstringThe 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_policystringThe JSON body of the resource-based policy. (pattern: <code>[\u0009\u000A\u000D\u0020-\u00FF]+</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_resource_policyselectregionGets the details of a resource-based policy that is attached to a custom model, including the JSON body of the policy.
put_resource_policyreplaceregion, ResourceArn, ResourcePolicyAttaches 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_policydeleteregionDeletes 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.

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

SELECT examples

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

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

Deletes a resource-based policy that is attached to a custom model.

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