resource_policies
Creates, updates, deletes, gets or lists a resource_policies resource.
Overview
| Name | resource_policies |
| Type | Resource |
| Id | aws.ssm_incidents.resource_policies |
Fields
The following fields are returned by SELECT queries:
- get_resource_policies
| Name | Datatype | Description |
|---|---|---|
policy_document | string | The JSON blob that describes the policy. |
policy_id | string | The ID of the resource policy. |
ram_resource_share_region | string | The Amazon Web Services Region that policy allows resources to be used in. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_resource_policies | select | resourceArn, region | Retrieves the resource policies attached to the specified response plan. | |
put_resource_policy | replace | region, policy, resourceArn | Adds a resource policy to the specified response plan. The resource policy is used to share the response plan using Resource Access Manager (RAM). For more information about cross-account sharing, see Cross-Region and cross-account incident management. | |
delete_resource_policy | delete | region | Deletes the resource policy that Resource Access Manager uses to share your Incident Manager resource. |
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) |
resourceArn | string | The Amazon Resource Name (ARN) of the response plan with the attached resource policy. |
SELECT examples
- get_resource_policies
Retrieves the resource policies attached to the specified response plan.
SELECT
policy_document,
policy_id,
ram_resource_share_region
FROM aws.ssm_incidents.resource_policies
WHERE resourceArn = '{{ resourceArn }}' -- required
AND region = '{{ region }}' -- required
;
REPLACE examples
- put_resource_policy
Adds a resource policy to the specified response plan. The resource policy is used to share the response plan using Resource Access Manager (RAM). For more information about cross-account sharing, see Cross-Region and cross-account incident management.
REPLACE aws.ssm_incidents.resource_policies
SET
policy = '{{ policy }}',
resourceArn = '{{ resourceArn }}'
WHERE
region = '{{ region }}' --required
AND policy = '{{ policy }}' --required
AND resourceArn = '{{ resourceArn }}' --required
RETURNING
policy_id;
DELETE examples
- delete_resource_policy
Deletes the resource policy that Resource Access Manager uses to share your Incident Manager resource.
DELETE FROM aws.ssm_incidents.resource_policies
WHERE region = '{{ region }}' --required
;