resource_policies
Creates, updates, deletes, gets or lists a resource_policies resource.
Overview
| Name | resource_policies |
| Type | Resource |
| Id | aws.xray.resource_policies |
Fields
The following fields are returned by SELECT queries:
- list_resource_policies
| Name | Datatype | Description |
|---|---|---|
last_updated_time | string (date-time) | When the policy was last updated, in Unix time seconds. |
policy_document | string | The resource policy document, which can be up to 5kb in size. |
policy_name | string | The name of the resource policy. Must be unique within a specific Amazon Web Services account. (pattern: <code>[\w+=,.@-]+</code>) |
policy_revision_id | string | Returns the current policy revision id for this policy name. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_resource_policies | select | region | Returns the list of resource policies in the target Amazon Web Services account. | |
put_resource_policy | replace | region, PolicyName, PolicyDocument | Sets the resource policy to grant one or more Amazon Web Services services and accounts permissions to access X-Ray. Each resource policy will be associated with a specific Amazon Web Services account. Each Amazon Web Services account can have a maximum of 5 resource policies, and each policy name must be unique within that account. The maximum size of each resource policy is 5KB. | |
delete_resource_policy | delete | region | Deletes a resource policy from the target Amazon Web Services account. |
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
- list_resource_policies
Returns the list of resource policies in the target Amazon Web Services account.
SELECT
last_updated_time,
policy_document,
policy_name,
policy_revision_id
FROM aws.xray.resource_policies
WHERE region = '{{ region }}' -- required
;
REPLACE examples
- put_resource_policy
Sets the resource policy to grant one or more Amazon Web Services services and accounts permissions to access X-Ray. Each resource policy will be associated with a specific Amazon Web Services account. Each Amazon Web Services account can have a maximum of 5 resource policies, and each policy name must be unique within that account. The maximum size of each resource policy is 5KB.
REPLACE aws.xray.resource_policies
SET
PolicyName = '{{ PolicyName }}',
PolicyDocument = '{{ PolicyDocument }}',
PolicyRevisionId = '{{ PolicyRevisionId }}',
BypassPolicyLockoutCheck = {{ BypassPolicyLockoutCheck }}
WHERE
region = '{{ region }}' --required
AND PolicyName = '{{ PolicyName }}' --required
AND PolicyDocument = '{{ PolicyDocument }}' --required
RETURNING
resource_policy;
DELETE examples
- delete_resource_policy
Deletes a resource policy from the target Amazon Web Services account.
DELETE FROM aws.xray.resource_policies
WHERE region = '{{ region }}' --required
;