Skip to main content

resource_policies

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

Overview

Nameresource_policies
TypeResource
Idaws.xray.resource_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
last_updated_timestring (date-time)When the policy was last updated, in Unix time seconds.
policy_documentstringThe resource policy document, which can be up to 5kb in size.
policy_namestringThe name of the resource policy. Must be unique within a specific Amazon Web Services account. (pattern: <code>[\w+=,.@-]+</code>)
policy_revision_idstringReturns the current policy revision id for this policy name.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_resource_policiesselectregionReturns the list of resource policies in the target Amazon Web Services account.
put_resource_policyreplaceregion, PolicyName, PolicyDocumentSets 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_policydeleteregionDeletes 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.

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

SELECT examples

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

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

Deletes a resource policy from the target Amazon Web Services account.

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