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::APS::ResourcePolicy
Idawscc.aps.resource_policies

Fields

NameDatatypeDescription
workspace_arnstringThe Arn of an APS Workspace that the PolicyDocument will be attached to.
policy_documentstringThe JSON to use as the Resource-based Policy.
regionstringAWS region.

For more information, see AWS::APS::ResourcePolicy.

Methods

NameResourceAccessible byRequired Params
create_resourceresource_policiesINSERTWorkspaceArn, PolicyDocument, region
delete_resourceresource_policiesDELETEIdentifier, region
update_resourceresource_policiesUPDATEIdentifier, PatchDocument, region
list_resourcesresource_policies_list_onlySELECTregion
get_resourceresource_policiesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual resource_policy.

SELECT
region,
workspace_arn,
policy_document
FROM awscc.aps.resource_policies
WHERE
region = 'us-east-1' AND
Identifier = '{{ workspace_arn }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.aps.resource_policies (
WorkspaceArn,
PolicyDocument,
region
)
SELECT
'{{ workspace_arn }}',
'{{ policy_document }}',
'{{ region }}';

UPDATE example

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

/*+ update */
UPDATE awscc.aps.resource_policies
SET PatchDocument = string('{{ {
"PolicyDocument": policy_document
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ workspace_arn }}';

DELETE example

/*+ delete */
DELETE FROM awscc.aps.resource_policies
WHERE
Identifier = '{{ workspace_arn }}' AND
region = 'us-east-1';

Permissions

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

aps:PutResourcePolicy,
aps:DescribeResourcePolicy