Skip to main content

repository_permissions_policies

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

Overview

Namerepository_permissions_policies
TypeResource
Idaws.codeartifact.repository_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_repository_permissions_policyselectdomain, repository, regiondomain-ownerReturns the resource policy that is set on a repository.
put_repository_permissions_policyreplacedomain, repository, region, policyDocumentdomain-ownerSets the resource policy on a repository that specifies permissions to access it. When you call PutRepositoryPermissionsPolicy, the resource policy on the repository is ignored when evaluting permissions. This ensures that the owner of a repository cannot lock themselves out of the repository, which would prevent them from being able to update the resource policy.
delete_repository_permissions_policydeletedomain, repository, regiondomain-owner, policy-revisionDeletes the resource policy that is set on a repository. After a resource policy is deleted, the permissions allowed and denied by the deleted policy are removed. The effect of deleting a resource policy might not be immediate. Use DeleteRepositoryPermissionsPolicy with caution. After a policy is deleted, Amazon Web Services users, roles, and accounts lose permissions to perform the repository actions granted by the deleted policy.

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 that contains the repository associated with the resource policy to be deleted.
regionstringAWS region (default: us-east-1)
repositorystringThe name of the repository that is associated with the resource policy to be deleted
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 revision of the repository's resource policy to be deleted. This revision is used for optimistic locking, which prevents others from accidentally overwriting your changes to the repository's resource policy.

SELECT examples

Returns the resource policy that is set on a repository.

SELECT
document,
resource_arn,
revision
FROM aws.codeartifact.repository_permissions_policies
WHERE domain = '{{ domain }}' -- required
AND repository = '{{ repository }}' -- required
AND region = '{{ region }}' -- required
AND `domain-owner` = '{{ domain-owner }}'
;

REPLACE examples

Sets the resource policy on a repository that specifies permissions to access it. When you call PutRepositoryPermissionsPolicy, the resource policy on the repository is ignored when evaluting permissions. This ensures that the owner of a repository cannot lock themselves out of the repository, which would prevent them from being able to update the resource policy.

REPLACE aws.codeartifact.repository_permissions_policies
SET
policyRevision = '{{ policyRevision }}',
policyDocument = '{{ policyDocument }}'
WHERE
domain = '{{ domain }}' --required
AND repository = '{{ repository }}' --required
AND region = '{{ region }}' --required
AND policyDocument = '{{ policyDocument }}' --required
AND `domain-owner` = '{{ domain-owner}}'
RETURNING
policy;

DELETE examples

Deletes the resource policy that is set on a repository. After a resource policy is deleted, the permissions allowed and denied by the deleted policy are removed. The effect of deleting a resource policy might not be immediate. Use DeleteRepositoryPermissionsPolicy with caution. After a policy is deleted, Amazon Web Services users, roles, and accounts lose permissions to perform the repository actions granted by the deleted policy.

DELETE FROM aws.codeartifact.repository_permissions_policies
WHERE domain = '{{ domain }}' --required
AND repository = '{{ repository }}' --required
AND region = '{{ region }}' --required
AND `domain-owner` = '{{ domain-owner }}'
AND `policy-revision` = '{{ policy-revision }}'
;