Skip to main content

resource_policies

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

Overview

Nameresource_policies
TypeResource
Idaws.glue.resource_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
create_timestring (date-time)The date and time at which the policy was created.
policy_hashstringContains the hash value associated with this policy. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>)
policy_in_jsonstringContains the requested policy document, in JSON format.
update_timestring (date-time)The date and time at which the policy was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_resource_policiesselectregionRetrieves the resource policies set on individual resources by Resource Access Manager during cross-account permission grants. Also retrieves the Data Catalog resource policy. If you enabled metadata encryption in Data Catalog settings, and you do not have permission on the KMS key, the operation can't return the Data Catalog resource policy.
put_resource_policyreplaceregion, PolicyInJsonSets the Data Catalog resource policy for access control.
delete_resource_policydeleteregionDeletes a specified policy.
get_resource_policyexecregionRetrieves a specified resource policy.

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

Retrieves the resource policies set on individual resources by Resource Access Manager during cross-account permission grants. Also retrieves the Data Catalog resource policy. If you enabled metadata encryption in Data Catalog settings, and you do not have permission on the KMS key, the operation can't return the Data Catalog resource policy.

SELECT
create_time,
policy_hash,
policy_in_json,
update_time
FROM aws.glue.resource_policies
WHERE region = '{{ region }}' -- required
;

REPLACE examples

Sets the Data Catalog resource policy for access control.

REPLACE aws.glue.resource_policies
SET
PolicyInJson = '{{ PolicyInJson }}',
ResourceArn = '{{ ResourceArn }}',
PolicyHashCondition = '{{ PolicyHashCondition }}',
PolicyExistsCondition = '{{ PolicyExistsCondition }}',
EnableHybrid = '{{ EnableHybrid }}'
WHERE
region = '{{ region }}' --required
AND PolicyInJson = '{{ PolicyInJson }}' --required
RETURNING
policy_hash;

DELETE examples

Deletes a specified policy.

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

Lifecycle Methods

Retrieves a specified resource policy.

EXEC aws.glue.resource_policies.get_resource_policy
@region='{{ region }}' --required
@@json=
'{
"ResourceArn": "{{ ResourceArn }}"
}'
;