repository_permissions_policies
Creates, updates, deletes, gets or lists a repository_permissions_policies resource.
Overview
| Name | repository_permissions_policies |
| Type | Resource |
| Id | aws.codeartifact.repository_permissions_policies |
Fields
The following fields are returned by SELECT queries:
- get_repository_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_repository_permissions_policy | select | domain, repository, region | domain-owner | Returns the resource policy that is set on a repository. |
put_repository_permissions_policy | replace | domain, repository, region, policyDocument | domain-owner | 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. |
delete_repository_permissions_policy | delete | domain, repository, region | domain-owner, policy-revision | 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. |
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 that contains the repository associated with the resource policy to be deleted. |
region | string | AWS region (default: us-east-1) |
repository | string | The name of the repository that is associated with the resource policy to be deleted |
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 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
- get_repository_permissions_policy
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
- put_repository_permissions_policy
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
- delete_repository_permissions_policy
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 }}'
;