policies
Creates, updates, deletes, gets or lists a policies resource.
Overview
| Name | policies |
| Type | Resource |
| Id | aws.entityresolution.policies |
Fields
The following fields are returned by SELECT queries:
- get_policy
| Name | Datatype | Description |
|---|---|---|
arn | string | The Entity Resolution resource ARN. (pattern: <code>arn:(aws|aws-us-gov|aws-cn):entityresolution:[a-z]{2}-[a-z]{1,10}-[0-9]:[0-9]{12}:((schemamapping|matchingworkflow|idmappingworkflow|idnamespace)/[a-zA-Z_0-9-]{1,255})</code>) |
policy | string | The resource-based policy. |
token | string | A unique identifier for the current revision of the policy. (pattern: <code>[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_policy | select | arn, region | Returns the resource-based policy. | |
add_policy_statement | update | arn, statement_id, region, effect, action, principal | Adds a policy statement object. To retrieve a list of existing policy statements, use the GetPolicy API. | |
put_policy | replace | arn, region, policy | Updates the resource-based policy. | |
delete_policy_statement | delete | arn, statement_id, region | Deletes the policy statement. |
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 |
|---|---|---|
arn | string | The ARN of the resource for which the policy need to be deleted. |
region | string | AWS region (default: us-east-1) |
statement_id | string | A statement identifier that differentiates the statement from others in the same policy. |
SELECT examples
- get_policy
Returns the resource-based policy.
SELECT
arn,
policy,
token
FROM aws.entityresolution.policies
WHERE arn = '{{ arn }}' -- required
AND region = '{{ region }}' -- required
;
UPDATE examples
- add_policy_statement
Adds a policy statement object. To retrieve a list of existing policy statements, use the GetPolicy API.
UPDATE aws.entityresolution.policies
SET
effect = '{{ effect }}',
action = '{{ action }}',
principal = '{{ principal }}',
condition = '{{ condition }}'
WHERE
arn = '{{ arn }}' --required
AND statement_id = '{{ statement_id }}' --required
AND region = '{{ region }}' --required
AND effect = '{{ effect }}' --required
AND action = '{{ action }}' --required
AND principal = '{{ principal }}' --required
RETURNING
arn,
policy,
token;
REPLACE examples
- put_policy
Updates the resource-based policy.
REPLACE aws.entityresolution.policies
SET
token = '{{ token }}',
policy = '{{ policy }}'
WHERE
arn = '{{ arn }}' --required
AND region = '{{ region }}' --required
AND policy = '{{ policy }}' --required
RETURNING
arn,
policy,
token;
DELETE examples
- delete_policy_statement
Deletes the policy statement.
DELETE FROM aws.entityresolution.policies
WHERE arn = '{{ arn }}' --required
AND statement_id = '{{ statement_id }}' --required
AND region = '{{ region }}' --required
;