resource_policies
Creates, updates, deletes, gets or lists a resource_policies resource.
Overview
| Name | resource_policies |
| Type | Resource |
| Id | aws.cloudtrail.resource_policies |
Fields
The following fields are returned by SELECT queries:
- get_resource_policy
| Name | Datatype | Description |
|---|---|---|
delegated_admin_resource_policy | string | The 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_arn | string | The 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_policy | string | A 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_resource_policy | select | region | Retrieves the JSON text of the resource-based policy document attached to the CloudTrail event data store, dashboard, or channel. | |
put_resource_policy | replace | region, ResourceArn, ResourcePolicy | 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. | |
delete_resource_policy | delete | region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_resource_policy
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
- put_resource_policy
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
- delete_resource_policy
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
;