resource_policies
Creates, updates, deletes or gets a resource_policy resource or lists resource_policies in a region
Overview
| Name | resource_policies |
| Type | Resource |
| Description | You 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. |
| Id | awscc.organizations.resource_policies |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier (ID) associated with this resource policy. |
arn | string | The Amazon Resource Name (ARN) of the resource policy. |
content | object | The 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. |
tags | array | A list of tags that you want to attach to the resource policy |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier (ID) associated with this resource policy. |
region | string | AWS region. |
For more information, see AWS::Organizations::ResourcePolicy.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | resource_policies | INSERT | Content, region |
delete_resource | resource_policies | DELETE | Identifier, region |
update_resource | resource_policies | UPDATE | Identifier, PatchDocument, region |
list_resources | resource_policies_list_only | SELECT | region |
get_resource | resource_policies | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual resource_policy.
SELECT
region,
id,
arn,
content,
tags
FROM awscc.organizations.resource_policies
WHERE
region = 'us-east-1' AND
Identifier = '{{ id }}';
Lists all resource_policies in a region.
SELECT
region,
id
FROM awscc.organizations.resource_policies_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new resource_policy resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.organizations.resource_policies (
Content,
region
)
SELECT
'{{ content }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.organizations.resource_policies (
Content,
Tags,
region
)
SELECT
'{{ content }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: resource_policy
props:
- name: content
value: {}
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a resource_policy resource, using stack-deploy.
/*+ update */
UPDATE awscc.organizations.resource_policies
SET PatchDocument = string('{{ {
"Content": content,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}';
DELETE example
/*+ delete */
DELETE FROM awscc.organizations.resource_policies
WHERE
Identifier = '{{ id }}' AND
region = 'us-east-1';
Permissions
To operate on the resource_policies resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
organizations:PutResourcePolicy,
organizations:DescribeResourcePolicy,
organizations:ListTagsForResource,
organizations:TagResource
organizations:DescribeResourcePolicy,
organizations:ListTagsForResource
organizations:DescribeResourcePolicy,
organizations:PutResourcePolicy,
organizations:ListTagsForResource,
organizations:TagResource,
organizations:UntagResource
organizations:DeleteResourcePolicy
organizations:DescribeResourcePolicy