Skip to main content

policies

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

Overview

Namepolicies
TypeResource
Idaws.clouddirectory.policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
pathstringThe path that is referenced from the root.
policiesarrayList of policy objects.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
lookup_policyselectx-amz-data-partition, regionLists all policies from the root of the Directory to the object specified. If there are no policies present, an empty list is returned. If policies are present, and if some objects don't have the policies attached, it returns the ObjectIdentifier for such objects. If policies are present, it returns ObjectIdentifier, policyId, and policyType. Paths that don't lead to the root from the target object are ignored. For more information, see Policies.
attach_policyupdatex-amz-data-partition, region, PolicyReference, ObjectReferenceAttaches a policy object to a regular object. An object can have a limited number of attached policies.
detach_policyexecx-amz-data-partition, region, PolicyReference, ObjectReferenceDetaches a policy from an object.

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
regionstringAWS region (default: us-east-1)
x-amz-data-partitionstringThe Amazon Resource Name (ARN) that is associated with the Directory where both objects reside. For more information, see arns.

SELECT examples

Lists all policies from the root of the Directory to the object specified. If there are no policies present, an empty list is returned. If policies are present, and if some objects don't have the policies attached, it returns the ObjectIdentifier for such objects. If policies are present, it returns ObjectIdentifier, policyId, and policyType. Paths that don't lead to the root from the target object are ignored. For more information, see Policies.

SELECT
path,
policies
FROM aws.clouddirectory.policies
WHERE `x-amz-data-partition` = '{{ x-amz-data-partition }}' -- required
AND region = '{{ region }}' -- required
;

UPDATE examples

Attaches a policy object to a regular object. An object can have a limited number of attached policies.

UPDATE aws.clouddirectory.policies
SET
PolicyReference = '{{ PolicyReference }}',
ObjectReference = '{{ ObjectReference }}'
WHERE
`x-amz-data-partition` = '{{ x-amz-data-partition }}' --required
AND region = '{{ region }}' --required
AND PolicyReference = '{{ PolicyReference }}' --required
AND ObjectReference = '{{ ObjectReference }}' --required;

Lifecycle Methods

Detaches a policy from an object.

EXEC aws.clouddirectory.policies.detach_policy
@x-amz-data-partition='{{ x-amz-data-partition }}' --required,
@region='{{ region }}' --required
@@json=
'{
"PolicyReference": "{{ PolicyReference }}",
"ObjectReference": "{{ ObjectReference }}"
}'
;