resource_policies
Creates, updates, deletes, gets or lists a resource_policies resource.
Overview
| Name | resource_policies |
| Type | Resource |
| Id | aws.rum.resource_policies |
Fields
The following fields are returned by SELECT queries:
- get_resource_policy
| Name | Datatype | Description |
|---|---|---|
policy_document | string | The JSON policy document that you requested. |
policy_revision_id | string | The revision ID information for this version of the policy document that you requested. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_resource_policy | select | name, region | Use this operation to retrieve information about a resource-based policy that is attached to an app monitor. | |
put_resource_policy | replace | name, region, PolicyDocument | Use this operation to assign a resource-based policy to a CloudWatch RUM app monitor to control access to it. Each app monitor can have one resource-based policy. The maximum size of the policy is 4 KB. To learn more about using resource policies with RUM, see Using resource-based policies with CloudWatch RUM. | |
delete_resource_policy | delete | name, region | policyRevisionId | Removes the association of a resource-based policy from an app monitor. |
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 |
|---|---|---|
name | string | The app monitor that you want to remove the resource policy from. |
region | string | AWS region (default: us-east-1) |
policyRevisionId | string | Specifies a specific policy revision to delete. Provide a PolicyRevisionId to ensure an atomic delete operation. If the revision ID that you provide doesn't match the latest policy revision ID, the request will be rejected with an InvalidPolicyRevisionIdException error. |
SELECT examples
- get_resource_policy
Use this operation to retrieve information about a resource-based policy that is attached to an app monitor.
SELECT
policy_document,
policy_revision_id
FROM aws.rum.resource_policies
WHERE name = '{{ name }}' -- required
AND region = '{{ region }}' -- required
;
REPLACE examples
- put_resource_policy
Use this operation to assign a resource-based policy to a CloudWatch RUM app monitor to control access to it. Each app monitor can have one resource-based policy. The maximum size of the policy is 4 KB. To learn more about using resource policies with RUM, see Using resource-based policies with CloudWatch RUM.
REPLACE aws.rum.resource_policies
SET
PolicyDocument = '{{ PolicyDocument }}',
PolicyRevisionId = '{{ PolicyRevisionId }}'
WHERE
name = '{{ name }}' --required
AND region = '{{ region }}' --required
AND PolicyDocument = '{{ PolicyDocument }}' --required
RETURNING
policy_document,
policy_revision_id;
DELETE examples
- delete_resource_policy
Removes the association of a resource-based policy from an app monitor.
DELETE FROM aws.rum.resource_policies
WHERE name = '{{ name }}' --required
AND region = '{{ region }}' --required
AND policyRevisionId = '{{ policyRevisionId }}'
;