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
DescriptionYou can use AWS::Organizations::ResourcePolicy to delegate policy management for AWS Organizations to specified member accounts to perform policy actions that are by default available only to the management account.
Idaws.organizations.resource_policies

Fields

NameDatatypeDescription
idstringThe unique identifier (ID) associated with this resource policy.
arnstringThe Amazon Resource Name (ARN) of the resource policy.
contentobjectThe policy document. For AWS CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. AWS CloudFormation always converts a YAML policy to JSON format before submitting it.
tagsarrayA list of tags that you want to attach to the resource policy
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTContent, 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,
id,
arn,
content,
tags
FROM aws.organizations.resource_policies
WHERE region = 'us-east-1';

Gets all properties from an individual resource_policy.

SELECT
region,
id,
arn,
content,
tags
FROM aws.organizations.resource_policies
WHERE region = 'us-east-1' AND data__Identifier = '<Id>';

INSERT example

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

/*+ create */
INSERT INTO aws.organizations.resource_policies (
Content,
region
)
SELECT
'{{ Content }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.organizations.resource_policies
WHERE data__Identifier = '<Id>'
AND region = 'us-east-1';

Permissions

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

Create

organizations:PutResourcePolicy,
organizations:DescribeResourcePolicy,
organizations:ListTagsForResource,
organizations:TagResource

Read

organizations:DescribeResourcePolicy,
organizations:ListTagsForResource

Update

organizations:DescribeResourcePolicy,
organizations:PutResourcePolicy,
organizations:ListTagsForResource,
organizations:TagResource,
organizations:UntagResource

Delete

organizations:DeleteResourcePolicy

List

organizations:DescribeResourcePolicy