Skip to main content

resource_policies

Creates, updates, deletes, gets or lists a resource_policies resource.

Overview

Nameresource_policies
TypeResource
Idaws.migration_hub_refactor_spaces.resource_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
policystringA JSON-formatted string for an Amazon Web Services resource-based policy. (pattern: <code>^.\S.$</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_resource_policyselectidentifier, regionGets the resource-based permission policy that is set for the given environment.
put_resource_policyreplaceregion, ResourceArnAttaches a resource-based permission policy to the Amazon Web Services Migration Hub Refactor Spaces environment. The policy must contain the same actions and condition statements as the arn:aws🐏:aws:permission/AWSRAMDefaultPermissionRefactorSpacesEnvironment permission in Resource Access Manager. The policy must not contain new lines or blank lines.
delete_resource_policydeleteidentifier, regionDeletes the resource policy set for the environment.

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.

NameDatatypeDescription
identifierstringAmazon Resource Name (ARN) of the resource associated with the policy.
regionstringAWS region (default: us-east-1)

SELECT examples

Gets the resource-based permission policy that is set for the given environment.

SELECT
policy
FROM aws.migration_hub_refactor_spaces.resource_policies
WHERE identifier = '{{ identifier }}' -- required
AND region = '{{ region }}' -- required
;

REPLACE examples

Attaches a resource-based permission policy to the Amazon Web Services Migration Hub Refactor Spaces environment. The policy must contain the same actions and condition statements as the arn:aws🐏:aws:permission/AWSRAMDefaultPermissionRefactorSpacesEnvironment permission in Resource Access Manager. The policy must not contain new lines or blank lines.

REPLACE aws.migration_hub_refactor_spaces.resource_policies
SET
Policy = '{{ Policy }}',
ResourceArn = '{{ ResourceArn }}'
WHERE
region = '{{ region }}' --required
AND ResourceArn = '{{ ResourceArn }}' --required;

DELETE examples

Deletes the resource policy set for the environment.

DELETE FROM aws.migration_hub_refactor_spaces.resource_policies
WHERE identifier = '{{ identifier }}' --required
AND region = '{{ region }}' --required
;