Skip to main content

domain_permissions_policies

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

Overview

Namedomain_permissions_policies
TypeResource
Idaws.codeartifact.domain_permissions_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
documentstringThe resource policy formatted in JSON. (pattern: <code>[\P{C}\s]+</code>)
resource_arnstringThe ARN of the resource associated with the resource policy (pattern: <code>\S+</code>)
revisionstringThe current revision of the resource policy. (pattern: <code>\S+</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_domain_permissions_policyselectdomain, regiondomain-ownerReturns 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_policyreplaceregion, domain, policyDocumentSets 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_policydeletedomain, regiondomain-owner, policy-revisionDeletes 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.

NameDatatypeDescription
domainstringThe name of the domain associated with the resource policy to be deleted.
regionstringAWS region (default: us-east-1)
domain-ownerstringThe 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.
policy-revisionstringThe 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

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

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

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 }}'
;