Skip to main content

repositories

Creates, updates, deletes or gets a repository resource or lists repositories in a region

Overview

Namerepositories
TypeResource
DescriptionThe resource schema to create a CodeArtifact repository.
Idaws.codeartifact.repositories

Fields

NameDatatypeDescription
repository_namestringThe name of the repository.
namestringThe name of the repository. This is used for GetAtt
domain_namestringThe name of the domain that contains the repository.
domain_ownerstringThe 12-digit account ID of the AWS account that owns the domain.
descriptionstringA text description of the repository.
arnstringThe ARN of the repository.
external_connectionsarrayA list of external connections associated with the repository.
upstreamsarrayA list of upstream repositories associated with the repository.
permissions_policy_documentobjectThe access control resource policy on the provided repository.
tagsarrayAn array of key-value pairs to apply to this resource.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTRepositoryName, DomainName, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all repositories in a region.

SELECT
region,
repository_name,
name,
domain_name,
domain_owner,
description,
arn,
external_connections,
upstreams,
permissions_policy_document,
tags
FROM aws.codeartifact.repositories
WHERE region = 'us-east-1';

Gets all properties from an individual repository.

SELECT
region,
repository_name,
name,
domain_name,
domain_owner,
description,
arn,
external_connections,
upstreams,
permissions_policy_document,
tags
FROM aws.codeartifact.repositories
WHERE region = 'us-east-1' AND data__Identifier = '<Arn>';

INSERT example

Use the following StackQL query and manifest file to create a new repository resource, using stack-deploy.

/*+ create */
INSERT INTO aws.codeartifact.repositories (
RepositoryName,
DomainName,
region
)
SELECT
'{{ RepositoryName }}',
'{{ DomainName }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.codeartifact.repositories
WHERE data__Identifier = '<Arn>'
AND region = 'us-east-1';

Permissions

To operate on the repositories resource, the following permissions are required:

Create

codeartifact:CreateRepository,
codeartifact:DescribeRepository,
codeartifact:PutRepositoryPermissionsPolicy,
codeartifact:AssociateExternalConnection,
codeartifact:AssociateWithDownstreamRepository,
codeartifact:TagResource

Read

codeartifact:DescribeRepository,
codeartifact:GetRepositoryPermissionsPolicy,
codeartifact:ListTagsForResource

Update

codeartifact:PutRepositoryPermissionsPolicy,
codeartifact:DeleteRepositoryPermissionsPolicy,
codeartifact:AssociateExternalConnection,
codeartifact:DisassociateExternalConnection,
codeartifact:UpdateRepository,
codeartifact:DescribeRepository,
codeartifact:AssociateWithDownstreamRepository,
codeartifact:TagResource,
codeartifact:UntagResource

Delete

codeartifact:DeleteRepository,
codeartifact:DescribeRepository

List

codeartifact:ListRepositories