policies
Creates, updates, deletes, gets or lists a policies resource.
Overview
| Name | policies |
| Type | Resource |
| Id | aws.clouddirectory.policies |
Fields
The following fields are returned by SELECT queries:
- lookup_policy
| Name | Datatype | Description |
|---|---|---|
path | string | The path that is referenced from the root. |
policies | array | List of policy objects. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
lookup_policy | select | x-amz-data-partition, region | 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. | |
attach_policy | update | x-amz-data-partition, region, PolicyReference, ObjectReference | Attaches a policy object to a regular object. An object can have a limited number of attached policies. | |
detach_policy | exec | x-amz-data-partition, region, PolicyReference, ObjectReference | Detaches 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
x-amz-data-partition | string | The Amazon Resource Name (ARN) that is associated with the Directory where both objects reside. For more information, see arns. |
SELECT examples
- lookup_policy
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
- attach_policy
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
- detach_policy
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 }}"
}'
;