repositories
Creates, updates, deletes or gets a repository
resource or lists repositories
in a region
Overview
Name | repositories |
Type | Resource |
Description | The resource schema to create a CodeArtifact repository. |
Id | aws.codeartifact.repositories |
Fields
Name | Datatype | Description |
---|---|---|
repository_name | string | The name of the repository. |
name | string | The name of the repository. This is used for GetAtt |
domain_name | string | The name of the domain that contains the repository. |
domain_owner | string | The 12-digit account ID of the AWS account that owns the domain. |
description | string | A text description of the repository. |
arn | string | The ARN of the repository. |
external_connections | array | A list of external connections associated with the repository. |
upstreams | array | A list of upstream repositories associated with the repository. |
permissions_policy_document | object | The access control resource policy on the provided repository. |
tags | array | An array of key-value pairs to apply to this resource. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | RepositoryName, DomainName, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.codeartifact.repositories (
RepositoryName,
DomainName,
region
)
SELECT
'{{ RepositoryName }}',
'{{ DomainName }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.codeartifact.repositories (
RepositoryName,
DomainName,
Description,
ExternalConnections,
Upstreams,
PermissionsPolicyDocument,
Tags,
region
)
SELECT
'{{ RepositoryName }}',
'{{ DomainName }}',
'{{ Description }}',
'{{ ExternalConnections }}',
'{{ Upstreams }}',
'{{ PermissionsPolicyDocument }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: repository
props:
- name: RepositoryName
value: '{{ RepositoryName }}'
- name: DomainName
value: '{{ DomainName }}'
- name: Description
value: '{{ Description }}'
- name: ExternalConnections
value:
- '{{ ExternalConnections[0] }}'
- name: Upstreams
value:
- '{{ Upstreams[0] }}'
- name: PermissionsPolicyDocument
value: {}
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
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