Skip to main content

resource_policies

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

Overview

Nameresource_policies
TypeResource
Idaws.rum.resource_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
policy_documentstringThe JSON policy document that you requested.
policy_revision_idstringThe revision ID information for this version of the policy document that you requested.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_resource_policyselectname, regionUse this operation to retrieve information about a resource-based policy that is attached to an app monitor.
put_resource_policyreplacename, region, PolicyDocumentUse 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_policydeletename, regionpolicyRevisionIdRemoves 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.

NameDatatypeDescription
namestringThe app monitor that you want to remove the resource policy from.
regionstringAWS region (default: us-east-1)
policyRevisionIdstringSpecifies 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

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

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

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 }}'
;