Skip to main content

resource_policies

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

Overview

Nameresource_policies
TypeResource
Idaws.cloudtrail.resource_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
delegated_admin_resource_policystringThe default resource-based policy that is automatically generated for the delegated administrator of an Organizations organization. This policy will be evaluated in tandem with any policy you submit for the resource. For more information about this policy, see Default resource policy for delegated administrators.
resource_arnstringThe Amazon Resource Name (ARN) of the CloudTrail event data store, dashboard, or channel attached to resource-based policy. Example event data store ARN format: arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE Example dashboard ARN format: arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash Example channel ARN format: arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 (pattern: <code>^[a-zA-Z0-9._/-:]+$</code>)
resource_policystringA JSON-formatted string that contains the resource-based policy attached to the CloudTrail event data store, dashboard, or channel.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_resource_policyselectregionRetrieves the JSON text of the resource-based policy document attached to the CloudTrail event data store, dashboard, or channel.
put_resource_policyreplaceregion, ResourceArn, ResourcePolicyAttaches a resource-based permission policy to a CloudTrail event data store, dashboard, or channel. For more information about resource-based policies, see CloudTrail resource-based policy examples in the CloudTrail User Guide.
delete_resource_policydeleteregionDeletes the resource-based policy attached to the CloudTrail event data store, dashboard, or channel.

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 JSON text of the resource-based policy document attached to the CloudTrail event data store, dashboard, or channel.

SELECT
delegated_admin_resource_policy,
resource_arn,
resource_policy
FROM aws.cloudtrail.resource_policies
WHERE region = '{{ region }}' -- required
;

REPLACE examples

Attaches a resource-based permission policy to a CloudTrail event data store, dashboard, or channel. For more information about resource-based policies, see CloudTrail resource-based policy examples in the CloudTrail User Guide.

REPLACE aws.cloudtrail.resource_policies
SET
ResourceArn = '{{ ResourceArn }}',
ResourcePolicy = '{{ ResourcePolicy }}'
WHERE
region = '{{ region }}' --required
AND ResourceArn = '{{ ResourceArn }}' --required
AND ResourcePolicy = '{{ ResourcePolicy }}' --required
RETURNING
delegated_admin_resource_policy,
resource_arn,
resource_policy;

DELETE examples

Deletes the resource-based policy attached to the CloudTrail event data store, dashboard, or channel.

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