Skip to main content

policy_grants

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

Overview

Namepolicy_grants
TypeResource
Idaws.datazone.policy_grants

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
created_atstring (date-time)Specifies the timestamp at which policy grant member was created.
created_bystringSpecifies the user who created the policy grant member.
detailobjectThe details of the policy grant.
grant_idstringThe ID of the policy grant. (pattern: <code>[A-Za-z0-9+/]{10}</code>)
principalobjectThe policy grant principal.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_policy_grantsselectdomain_identifier, entity_type, entity_identifier, policyType, regionmaxResults, nextTokenLists policy grants.
add_policy_grantupdatedomain_identifier, entity_type, entity_identifier, region, policyType, principal, detailAdds a policy grant (an authorization policy) to a specified entity, including domain units, environment blueprint configurations, or environment profiles.
remove_policy_grantupdatedomain_identifier, entity_type, entity_identifier, region, policyType, principalRemoves 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.

NameDatatypeDescription
domain_identifierstringThe ID of the domain where you want to remove a policy grant.
entity_identifierstringThe ID of the entity from which you want to remove a policy grant.
entity_typestringThe type of the entity from which you want to remove a policy grant.
policyTypestringThe type of policy that you want to list.
regionstringAWS region (default: us-east-1)
maxResultsintegerThe 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.
nextTokenstringWhen 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

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

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;