domain_permissions_policies
Creates, updates, deletes, gets or lists a domain_permissions_policies resource.
Overview
| Name | domain_permissions_policies |
| Type | Resource |
| Id | aws.codeartifact.domain_permissions_policies |
Fields
The following fields are returned by SELECT queries:
- get_domain_permissions_policy
| Name | Datatype | Description |
|---|---|---|
document | string | The resource policy formatted in JSON. (pattern: <code>[\P{C}\s]+</code>) |
resource_arn | string | The ARN of the resource associated with the resource policy (pattern: <code>\S+</code>) |
revision | string | The current revision of the resource policy. (pattern: <code>\S+</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_domain_permissions_policy | select | domain, region | domain-owner | Returns the resource policy attached to the specified domain. The policy is a resource-based policy, not an identity-based policy. For more information, see Identity-based policies and resource-based policies in the IAM User Guide. |
put_domain_permissions_policy | replace | region, domain, policyDocument | Sets a resource policy on a domain that specifies permissions to access it. When you call PutDomainPermissionsPolicy, the resource policy on the domain is ignored when evaluting permissions. This ensures that the owner of a domain cannot lock themselves out of the domain, which would prevent them from being able to update the resource policy. | |
delete_domain_permissions_policy | delete | domain, region | domain-owner, policy-revision | Deletes the resource policy set on a domain. |
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 | string | The name of the domain associated with the resource policy to be deleted. |
region | string | AWS region (default: us-east-1) |
domain-owner | string | The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces. |
policy-revision | string | The current revision of the resource policy to be deleted. This revision is used for optimistic locking, which prevents others from overwriting your changes to the domain's resource policy. |
SELECT examples
- get_domain_permissions_policy
Returns the resource policy attached to the specified domain. The policy is a resource-based policy, not an identity-based policy. For more information, see Identity-based policies and resource-based policies in the IAM User Guide.
SELECT
document,
resource_arn,
revision
FROM aws.codeartifact.domain_permissions_policies
WHERE domain = '{{ domain }}' -- required
AND region = '{{ region }}' -- required
AND `domain-owner` = '{{ domain-owner }}'
;
REPLACE examples
- put_domain_permissions_policy
Sets a resource policy on a domain that specifies permissions to access it. When you call PutDomainPermissionsPolicy, the resource policy on the domain is ignored when evaluting permissions. This ensures that the owner of a domain cannot lock themselves out of the domain, which would prevent them from being able to update the resource policy.
REPLACE aws.codeartifact.domain_permissions_policies
SET
domain = '{{ domain }}',
domainOwner = '{{ domainOwner }}',
policyRevision = '{{ policyRevision }}',
policyDocument = '{{ policyDocument }}'
WHERE
region = '{{ region }}' --required
AND domain = '{{ domain }}' --required
AND policyDocument = '{{ policyDocument }}' --required
RETURNING
policy;
DELETE examples
- delete_domain_permissions_policy
Deletes the resource policy set on a domain.
DELETE FROM aws.codeartifact.domain_permissions_policies
WHERE domain = '{{ domain }}' --required
AND region = '{{ region }}' --required
AND `domain-owner` = '{{ domain-owner }}'
AND `policy-revision` = '{{ policy-revision }}'
;