Skip to main content

resource_policies

Creates, updates, deletes or gets a resource_policy resource or lists resource_policies in a region

Overview

Nameresource_policies
TypeResource
DescriptionResource Type definition for AWS::SSM::ResourcePolicy
Idaws.ssm.resource_policies

Fields

NameDatatypeDescription
resource_arnstringArn of OpsItemGroup etc.
policyobjectActual policy statement.
policy_idstringAn unique identifier within the policies of a resource.
policy_hashstringA snapshot identifier for the policy over time.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTResourceArn, Policy, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all resource_policies in a region.

SELECT
region,
resource_arn,
policy,
policy_id,
policy_hash
FROM aws.ssm.resource_policies
WHERE region = 'us-east-1';

Gets all properties from an individual resource_policy.

SELECT
region,
resource_arn,
policy,
policy_id,
policy_hash
FROM aws.ssm.resource_policies
WHERE region = 'us-east-1' AND data__Identifier = '<PolicyId>|<ResourceArn>';

INSERT example

Use the following StackQL query and manifest file to create a new resource_policy resource, using stack-deploy.

/*+ create */
INSERT INTO aws.ssm.resource_policies (
ResourceArn,
Policy,
region
)
SELECT
'{{ ResourceArn }}',
'{{ Policy }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.ssm.resource_policies
WHERE data__Identifier = '<PolicyId|ResourceArn>'
AND region = 'us-east-1';

Permissions

To operate on the resource_policies resource, the following permissions are required:

Create

ssm:PutResourcePolicy

Read

ssm:GetResourcePolicies

Update

ssm:PutResourcePolicy

Delete

ssm:DeleteResourcePolicy

List

ssm:GetResourcePolicies