resource_policies
Creates, updates, deletes, gets or lists a resource_policies resource.
Overview
| Name | resource_policies |
| Type | Resource |
| Id | aws.glue.resource_policies |
Fields
The following fields are returned by SELECT queries:
- get_resource_policies
| Name | Datatype | Description |
|---|---|---|
create_time | string (date-time) | The date and time at which the policy was created. |
policy_hash | string | Contains the hash value associated with this policy. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>) |
policy_in_json | string | Contains the requested policy document, in JSON format. |
update_time | string (date-time) | The date and time at which the policy was last updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_resource_policies | select | region | 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. | |
put_resource_policy | replace | region, PolicyInJson | Sets the Data Catalog resource policy for access control. | |
delete_resource_policy | delete | region | Deletes a specified policy. | |
get_resource_policy | exec | region | Retrieves 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_resource_policies
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
- put_resource_policy
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
- delete_resource_policy
Deletes a specified policy.
DELETE FROM aws.glue.resource_policies
WHERE region = '{{ region }}' --required
;
Lifecycle Methods
- get_resource_policy
Retrieves a specified resource policy.
EXEC aws.glue.resource_policies.get_resource_policy
@region='{{ region }}' --required
@@json=
'{
"ResourceArn": "{{ ResourceArn }}"
}'
;