policy_grants
Creates, updates, deletes, gets or lists a policy_grants resource.
Overview
| Name | policy_grants |
| Type | Resource |
| Id | aws.datazone.policy_grants |
Fields
The following fields are returned by SELECT queries:
- list_policy_grants
| Name | Datatype | Description |
|---|---|---|
created_at | string (date-time) | Specifies the timestamp at which policy grant member was created. |
created_by | string | Specifies the user who created the policy grant member. |
detail | object | The details of the policy grant. |
grant_id | string | The ID of the policy grant. (pattern: <code>[A-Za-z0-9+/]{10}</code>) |
principal | object | The policy grant principal. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_policy_grants | select | domain_identifier, entity_type, entity_identifier, policyType, region | maxResults, nextToken | Lists policy grants. |
add_policy_grant | update | domain_identifier, entity_type, entity_identifier, region, policyType, principal, detail | Adds a policy grant (an authorization policy) to a specified entity, including domain units, environment blueprint configurations, or environment profiles. | |
remove_policy_grant | update | domain_identifier, entity_type, entity_identifier, region, policyType, principal | Removes a policy grant. |
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 |
|---|---|---|
domain_identifier | string | The ID of the domain where you want to remove a policy grant. |
entity_identifier | string | The ID of the entity from which you want to remove a policy grant. |
entity_type | string | The type of the entity from which you want to remove a policy grant. |
policyType | string | The type of policy that you want to list. |
region | string | AWS region (default: us-east-1) |
maxResults | integer | The maximum number of grants to return in a single call to ListPolicyGrants. When the number of grants to be listed is greater than the value of MaxResults, the response contains a NextToken value that you can use in a subsequent call to ListPolicyGrants to list the next set of grants. |
nextToken | string | When the number of grants is greater than the default value for the MaxResults parameter, or if you explicitly specify a value for MaxResults that is less than the number of grants, the response includes a pagination token named NextToken. You can specify this NextToken value in a subsequent call to ListPolicyGrants to list the next set of grants. |
SELECT examples
- list_policy_grants
Lists policy grants.
SELECT
created_at,
created_by,
detail,
grant_id,
principal
FROM aws.datazone.policy_grants
WHERE domain_identifier = '{{ domain_identifier }}' -- required
AND entity_type = '{{ entity_type }}' -- required
AND entity_identifier = '{{ entity_identifier }}' -- required
AND policyType = '{{ policyType }}' -- required
AND region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
UPDATE examples
- add_policy_grant
- remove_policy_grant
Adds a policy grant (an authorization policy) to a specified entity, including domain units, environment blueprint configurations, or environment profiles.
UPDATE aws.datazone.policy_grants
SET
policyType = '{{ policyType }}',
principal = '{{ principal }}',
detail = '{{ detail }}',
clientToken = '{{ clientToken }}'
WHERE
domain_identifier = '{{ domain_identifier }}' --required
AND entity_type = '{{ entity_type }}' --required
AND entity_identifier = '{{ entity_identifier }}' --required
AND region = '{{ region }}' --required
AND policyType = '{{ policyType }}' --required
AND principal = '{{ principal }}' --required
AND detail = '{{ detail }}' --required
RETURNING
grant_id;
Removes a policy grant.
UPDATE aws.datazone.policy_grants
SET
policyType = '{{ policyType }}',
principal = '{{ principal }}',
grantIdentifier = '{{ grantIdentifier }}',
clientToken = '{{ clientToken }}'
WHERE
domain_identifier = '{{ domain_identifier }}' --required
AND entity_type = '{{ entity_type }}' --required
AND entity_identifier = '{{ entity_identifier }}' --required
AND region = '{{ region }}' --required
AND policyType = '{{ policyType }}' --required
AND principal = '{{ principal }}' --required;