CodeArtifact examples using AWS CLI
The following code examples show you how to perform actions and implement common scenarios by using the AWS Command Line Interface with CodeArtifact.
Actions are code excerpts from larger programs and must be run in context. While actions show you how to call individual service functions, you can see actions in context in their related scenarios.
Each example includes a link to the complete source code, where you can find instructions on how to set up and run the code in context.
Topics
Actions
The following code example shows how to use associate-external-connection.
- AWS CLI
-
To add an external connection to a repository
The following
associate-external-connectionexample adds an external connection to npmjs.com to a repository named test-repo.aws codeartifact associate-external-connection \ --repositorytest-repo\ --domaintest-domain\ --external-connectionpublic:npmjsOutput:
{ "repository": { "name": "test-repo", "administratorAccount": "111122223333", "domainName": "test-domain", "domainOwner": "111122223333", "arn": "arn:aws:codeartifact:us-west-2:111122223333:repository/test-domain/test-repo", "upstreams": [], "externalConnections": [ { "externalConnectionName": "public:npmjs", "packageFormat": "npm", "status": "AVAILABLE" } ] } }For more information, see Add an external connection in the AWS CodeArtifact User Guide.
-
For API details, see AssociateExternalConnection
in AWS CLI Command Reference.
-
The following code example shows how to use copy-package-versions.
- AWS CLI
-
To copy package versions from one repository to another
The following
copy-package-versionsmoves versions 4.0.0 and 5.0.0 of a package named test-package from my-repo to test-repo.aws codeartifact copy-package-versions \ --domaintest-domain\ --source-repositorymy-repo\ --destination-repositorytest-repo\ --formatnpm\ --packagetest-package\ --versions '["4.0.0", "5.0.0"]'Output:
{ "format": "npm", "package": "test-package", "versions": [ { "version": "5.0.0", "revision": "REVISION-1-SAMPLE-6C81EFF7DA55CC", "status": "Published" }, { "version": "4.0.0", "revision": "REVISION-2-SAMPLE-55C752BEE772FC", "status": "Published" } ] }For more information, see Copy packages between repositories in the AWS CodeArtifact User Guide.
-
For API details, see CopyPackageVersions
in AWS CLI Command Reference.
-
The following code example shows how to use create-domain.
- AWS CLI
-
To create a domain
The following
create-domainexample creates a domain named test-domain.aws codeartifact create-domain \ --domaintest-domainOutput:
{ "domain": { "name": "test-domain", "owner": "111122223333", "arn": "arn:aws:codeartifact:us-west-2:111122223333:domain/test-domain", "status": "Active", "createdTime": "2020-10-20T13:16:48.559000-04:00", "encryptionKey": "arn:aws:kms:us-west-2:111122223333:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "repositoryCount": 0, "assetSizeBytes": 0 } }For more information, see Create a domain in the AWS CodeArtifact User Guide.
-
For API details, see CreateDomain
in AWS CLI Command Reference.
-
The following code example shows how to use create-repository.
- AWS CLI
-
To create a repository
The following
create-repositoryexample creates a repository named test-repo inside a domain named test-domain.aws codeartifact create-repository \ --domaintest-domain\ --domain-owner111122223333\ --repositorytest-repo\ --description"This is a test repository."Output:
{ "repository": { "name": "test-repo", "administratorAccount": "111122223333", "domainName": "test-domain", "domainOwner": "111122223333", "arn": "arn:aws:codeartifact:us-west-2:111122223333:repository/test-domain/test-repo", "description": "This is a test repository.", "upstreams": [], "externalConnections": [] } }For more information, see Create a domain in the AWS CodeArtifact User Guide.
-
For API details, see CreateRepository
in AWS CLI Command Reference.
-
The following code example shows how to use delete-domain-permissions-policy.
- AWS CLI
-
To delete the permissions policy document from a domain
The following
delete-domain-permissions-policyexample deletes the permission policy from a domain named test-domain.aws codeartifact delete-domain-permissions-policy \ --domaintest-domainOutput:
{ "Version":"2012-10-17", "Statement": [ { "Sid": "BasicDomainPolicy", "Action": [ "codeartifact:GetDomainPermissionsPolicy", "codeartifact:ListRepositoriesInDomain", "codeartifact:GetAuthorizationToken", "codeartifact:CreateRepository" ], "Effect": "Allow", "Resource": "*", "Principal": { "AWS": "arn:aws:iam::111122223333:root" } } ] }For more information, see Delete a domain policy in the AWS CodeArtifact User Guide.
-
For API details, see DeleteDomainPermissionsPolicy
in AWS CLI Command Reference.
-
The following code example shows how to use delete-domain.
- AWS CLI
-
To delete a domain
The following
delete-domainexample deletes a domain namedtest-domain.aws codeartifact delete-domain \ --domaintest-domainOutput:
{ "domain": { "name": "test-domain", "owner": "417498243647", "arn": "arn:aws:codeartifact:us-west-2:417498243647:domain/test-domain", "status": "Deleted", "createdTime": "2020-10-20T13:16:48.559000-04:00", "encryptionKey": "arn:aws:kms:us-west-2:417498243647:key/c9fe2447-0795-4fda-afbe-8464574ae162", "repositoryCount": 0, "assetSizeBytes": 0 } }For more information, see Delete a domain in the AWS CodeArtifact User Guide.
-
For API details, see DeleteDomain
in AWS CLI Command Reference.
-
The following code example shows how to use delete-package-versions.
- AWS CLI
-
To delete package versions
The following
delete-package-versionsexample deletes version 4.0.0 of a package named test-package.aws codeartifact delete-package-versions \ --domaintest-domain\ --repotest-repo\ --formatnpm\ --packagetest-package\ --versions4.0.0Output:
{ "successfulVersions": { "4.0.0": { "revision": "Ciqe5/9yicvkJT13b5/LdLpCyE6fqA7poa9qp+FilPs=", "status": "Deleted" } }, "failedVersions": {} }For more information, see Delete a package version in the AWS CodeArtifact User Guide.
-
For API details, see DeletePackageVersions
in AWS CLI Command Reference.
-
The following code example shows how to use delete-repository-permissions-policy.
- AWS CLI
-
To delete a permissions policy from a repository
The following
delete-repository-permissions-policyexample deletes the permission policy from a repository named test-repo.aws codeartifact delete-repository-permissions-policy \ --domaintest-domain\ --repositorytest-repoOutput:
{ "Version":"2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::111122223333:root" }, "Action": [ "codeartifact:DescribePackageVersion", "codeartifact:DescribeRepository", "codeartifact:GetPackageVersionReadme", "codeartifact:GetRepositoryEndpoint", "codeartifact:ListPackages", "codeartifact:ListPackageVersions", "codeartifact:ListPackageVersionAssets", "codeartifact:ListPackageVersionDependencies", "codeartifact:ReadFromRepository" ], "Resource": "*" } ] }For more information, see Delete a policy in the AWS CodeArtifact User Guide.
-
For API details, see DeleteRepositoryPermissionsPolicy
in AWS CLI Command Reference.
-
The following code example shows how to use delete-repository.
- AWS CLI
-
To delete a repository
The following
delete-repositoryexample deletes a repository namedtest-repoin a domain namedtest-domain.aws codeartifact delete-repository \ --domaintest-domain\ --repositorytest-repoOutput:
{ "repository": { "name": "test-repo", "administratorAccount": "111122223333", "domainName": "test-domain", "domainOwner": "111122223333", "arn": "arn:aws:codeartifact:us-west-2:111122223333:repository/test-domain/test-repo", "description": "This is a test repository", "upstreams": [], "externalConnections": [] } }For more information, see Delete a repository in the AWS CodeArtifact User Guide.
-
For API details, see DeleteRepository
in AWS CLI Command Reference.
-
The following code example shows how to use describe-domain.
- AWS CLI
-
To get information about a domain
The following
describe-domainexample returns a DomainDescription object for a domain named test-domain.aws codeartifact describe-domain \ --domaintest-domainOutput:
{ "domain": { "name": "test-domain", "owner": "111122223333", "arn": "arn:aws:codeartifact:us-west-2:111122223333:domain/test-domain", "status": "Active", "createdTime": "2020-10-20T13:16:48.559000-04:00", "encryptionKey": "arn:aws:kms:us-west-2:111122223333:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "repositoryCount": 2, "assetSizeBytes": 0, "s3BucketArn": "arn:aws:s3:::assets-111122223333-us-west-2" } }For more information, see Domain overview in the AWS CodeArtifact User Guide.
-
For API details, see DescribeDomain
in AWS CLI Command Reference.
-
The following code example shows how to use describe-repository.
- AWS CLI
-
To get information about a repository
The following
describe-repositoryexample returns a RepositoryDescription object for a repository named test-repo.aws codeartifact describe-repository \ --domaintest-domain\ --repositorytest-repoOutput:
{ "repository": { "name": "test-repo", "administratorAccount": "111122223333", "domainName": "test-domain", "domainOwner": "111122223333", "arn": "arn:aws:codeartifact:us-west-2:111122223333:repository/test-domain/test-repo", "description": "This is a test repository.", "upstreams": [], "externalConnections": [] } }For more information, see Create a domain in the AWS CodeArtifact User Guide.
-
For API details, see DescribeRepository
in AWS CLI Command Reference.
-
The following code example shows how to use disassociate-external-connection.
- AWS CLI
-
To remove an external connection from a repository
The following
disassociate-external-connectionexample removes an external connection to npmjs.com from a repository named test-repo.aws codeartifact disassociate-external-connection \ --repositorytest-repo\ --domaintest-domain\ --external-connectionpublic:npmjsOutput:
{ "repository": { "name": "test-repo", "administratorAccount": "111122223333", "domainName": "test-domain", "domainOwner": "111122223333", "arn": "arn:aws:codeartifact:us-west-2:111122223333:repository/test-domain/test-repo", "upstreams": [], "externalConnections": [] } }For more information, see Remove an external connection in the AWS CodeArtifact User Guide.
-
For API details, see DisassociateExternalConnection
in AWS CLI Command Reference.
-
The following code example shows how to use dispose-package-versions.
- AWS CLI
-
To delete a package version's assets and set its status to Disposed
The following
dispose-package-versionsexample deletes the assets of test-package version 4.0.0 and sets its status to Disposed.aws codeartifact dispose-package-versions \ --domaintest-domain\ --repotest-repo\ --formatnpm\ --packagetest-package\ --versions4.0.0Output:
{ "successfulVersions": { "4.0.0": { "revision": "Ciqe5/9yicvkJT13b5/LdLpCyE6fqA7poa9qp+FilPs=", "status": "Disposed" } }, "failedVersions": {} }For more information, see Working with packages in CodeArtifact in the AWS CodeArtifact User Guide.
-
For API details, see DisposePackageVersions
in AWS CLI Command Reference.
-
The following code example shows how to use get-authorization-token.
- AWS CLI
-
To get an authorization token
The following
get-authorization-tokenexample retrieves a CodeArtifact authorization token.aws codeartifact get-authorization-token \ --domaintest-domain\ --queryauthorizationToken\ --outputtextOutput:
This command will return the authorization token. You can store the output in an environment variable when calling the command.For more information, see Configure pip without the login command in the AWS CodeArtifact User Guide.
-
For API details, see GetAuthorizationToken
in AWS CLI Command Reference.
-
The following code example shows how to use get-domain-permissions-policy.
- AWS CLI
-
To get the permissions policy document for a domain
The following
get-domain-permissions-policyexample gets the permission policy attached to a domain named test-domain.aws codeartifact get-domain-permissions-policy \ --domaintest-domainOutput:
{ "Version":"2012-10-17", "Statement": [ { "Sid": "BasicDomainPolicy", "Action": [ "codeartifact:GetDomainPermissionsPolicy", "codeartifact:ListRepositoriesInDomain", "codeartifact:GetAuthorizationToken", "codeartifact:CreateRepository" ], "Effect": "Allow", "Resource": "*", "Principal": { "AWS": "arn:aws:iam::111122223333:root" } } ] }For more information, see Read a domain policy in the AWS CodeArtifact User Guide.
-
For API details, see GetDomainPermissionsPolicy
in AWS CLI Command Reference.
-
The following code example shows how to use get-package-version-asset.
- AWS CLI
-
To get an asset from a package version
The following
get-package-version-assetexample retrieves thepackage.tgzasset for version 4.0.0 of an npm package named test-package.aws codeartifact get-package-version-asset \ --domaintest-domain\ --repositorytest-repo\ --formatnpm\ --packagetest-package\ --package-version4.0.0\ --asset 'package.tgz' \outfileNameOutput:
The output for this command will also store the raw asset in the file provided in place of outfileName. { "assetName": "package.tgz", "packageVersion": "4.0.0", "packageVersionRevision": "Ciqe5/9yicvkJT13b5/LdLpCyE6fqA7poa9qp+FilPs=" }For more information, see List package version assets in the AWS CodeArtifact User Guide.
-
For API details, see GetPackageVersionAsset
in AWS CLI Command Reference.
-
The following code example shows how to use get-package-version-readme.
- AWS CLI
-
To get a package version's readme file
The following
get-package-version-readmeexample retrieves the readme file for version 4.0.0 of an npm package named test-package.aws codeartifact get-package-version-readme \ --domaintest-domain\ --repotest-repo\ --formatnpm\ --packagetest-package\ --package-version4.0.0Output:
{ "format": "npm", "package": "test-package", "version": "4.0.0", "readme": "<div align=\"center\">\n <a href=\https://github.com/test-package/testpack\"> ... more content ... \n", "versionRevision": "Ciqe5/9yicvkJT13b5/LdLpCyE6fqA7poa9qp+FilPs=" }For more information, see View package version readme file in the AWS CodeArtifact User Guide.
-
For API details, see GetPackageVersionReadme
in AWS CLI Command Reference.
-
The following code example shows how to use get-repository-endpoint.
- AWS CLI
-
To get a repository's URL endpoint
The following
get-repository-endpointexample returns the npm endpoint for the test-repo repository.aws codeartifact get-repository-endpoint \ --domaintest-domain\ --repositorytest-repo\ --formatnpmOutput:
{ "repositoryEndpoint": "https://test-domain-111122223333.d.codeartifact.us-west-2.amazonaws.com/npm/test-repo/" }For more information, see Connect to a repository in the AWS CodeArtifact User Guide.
-
For API details, see GetRepositoryEndpoint
in AWS CLI Command Reference.
-
The following code example shows how to use get-repository-permissions-policy.
- AWS CLI
-
To get the permissions policy document for a repository
The following
get-repository-permissions-policyexample gets the permission policy attached to a repository named test-repo.aws codeartifact get-repository-permissions-policy \ --domaintest-domain\ --repositorytest-repoOutput:
{ "Version":"2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::111122223333:root" }, "Action": [ "codeartifact:DescribePackageVersion", "codeartifact:DescribeRepository", "codeartifact:GetPackageVersionReadme", "codeartifact:GetRepositoryEndpoint", "codeartifact:ListPackages", "codeartifact:ListPackageVersions", "codeartifact:ListPackageVersionAssets", "codeartifact:ListPackageVersionDependencies", "codeartifact:ReadFromRepository" ], "Resource": "*" } ] }For more information, see Read a policy in the AWS CodeArtifact User Guide.
-
For API details, see GetRepositoryPermissionsPolicy
in AWS CLI Command Reference.
-
The following code example shows how to use list-domains.
- AWS CLI
-
To list domains
The following
list-domainsexample returns a summary of all domains owned by the AWS account that makes the call.aws codeartifact list-domainsOutput:
{ "domains": [ { "name": "my-domain", "owner": "111122223333", "status": "Active", "encryptionKey": "arn:aws:kms:us-west-2:111122223333:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" }, { "name": "test-domain", "owner": "111122223333", "status": "Active", "encryptionKey": "arn:aws:kms:us-west-2:111122223333:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222" } ] }For more information, see Working with domains in CodeArtifact in the AWS CodeArtifact User Guide.
-
For API details, see ListDomains
in AWS CLI Command Reference.
-
The following code example shows how to use list-package-version-assets.
- AWS CLI
-
To view a package version's assets
The following
list-package-version-assetsexample retrieves the assets for version 4.0.0 of an npm package named test-package.aws codeartifact list-package-version-assets \ --domaintest-domain\ --repotest-repo\ --formatnpm\ --packagetest-package\ --package-version4.0.0Output:
{ "format": "npm", "package": "test-package", "version": "4.0.0", "versionRevision": "Ciqe5/9yicvkJT13b5/LdLpCyE6fqA7poa9qp+FilPs=", "assets": [ { "name": "package.tgz", "size": 316680, "hashes": { "MD5": "60078ec6d9e76b89fb55c860832742b2", "SHA-1": "b44a9b6297bcb698f1c51a3545a2b3b368d59c52", "SHA-256": "d2aa8c6afc3c8591765785a37d1c5acae482a8eb3ab9729ed28922692454f2e2", "SHA-512": "3e585d15c8a594e20d7de57b362ea81754c011acb2641a19f1b72c8531ea39825896bab344ae616a0a5a824cb9a381df0b3cddd534645cf305aba70a93dac698" } } ] }For more information, see List package version assets in the AWS CodeArtifact User Guide.
-
For API details, see ListPackageVersionAssets
in AWS CLI Command Reference.
-
The following code example shows how to use list-package-version-dependencies.
- AWS CLI
-
To view a package version's dependencies
The following
list-package-version-dependenciesexample retrieves the dependencies for version 4.0.0 of an npm package named test-package.aws codeartifact list-package-version-dependencies \ --domaintest-domain\ --repotest-repo\ --formatnpm\ --packagetest-package\ --package-version4.0.0Output:
{ "format": "npm", "package": "test-package", "version": "4.0.0", "versionRevision": "Ciqe5/9yicvkJT13b5/LdLpCyE6fqA7poa9qp+FilPs=", "dependencies": [ { "namespace": "testns", "package": "testdep1", "dependencyType": "regular", "versionRequirement": "1.8.5" }, { "namespace": "testns", "package": "testdep2", "dependencyType": "regular", "versionRequirement": "1.8.5" } ] }For more information, see View and update package version details and dependencies in the AWS CodeArtifact User Guide.
-
For API details, see ListPackageVersionDependencies
in AWS CLI Command Reference.
-
The following code example shows how to use list-package-versions.
- AWS CLI
-
To list package versions for a package
The following
list-package-versionsexample returns a list of package versions for a package namedkind-of.aws codeartifact list-package-versions \ --packagekind-of\ --domaintest-domain\ --repositorytest-repo\ --formatnpmOutput:
{ "defaultDisplayVersion": "1.0.1", "format": "npm", "package": "kind-of", "versions": [ { "version": "1.0.1", "revision": "REVISION-SAMPLE-1-C7F4S5E9B772FC", "status": "Published" }, { "version": "1.0.0", "revision": "REVISION-SAMPLE-2-C752BEEF6D2CFC", "status": "Published" }, { "version": "0.1.2", "revision": "REVISION-SAMPLE-3-654S65A5C5E1FC", "status": "Published" }, { "version": "0.1.1", "revision": "REVISION-SAMPLE-1-C7F4S5E9B772FC"", "status": "Published" }, { "version": "0.1.0", "revision": "REVISION-SAMPLE-4-AF669139B772FC", "status": "Published" } ] }For more information, see List package versions in the AWS CodeArtifact User Guide.
-
For API details, see ListPackageVersions
in AWS CLI Command Reference.
-
The following code example shows how to use list-packages.
- AWS CLI
-
To list packages in a repository
The following
list-packagesexample list packages in a repository namedtest-repoin a domain namedtest-domain.aws codeartifact list-packages \ --domaintest-domain\ --repositorytest-repoOutput:
{ "packages": [ { "format": "npm", "package": "lodash" } { "format": "python", "package": "test-package" } ] }For more information, see List package names in the AWS CodeArtifact User Guide.
-
For API details, see ListPackages
in AWS CLI Command Reference.
-
The following code example shows how to use list-repositories-in-domain.
- AWS CLI
-
To list repositories in a domain
The following
list-repositories-in-domainexample returns a summary of all repositories in the test-domain domain.aws codeartifact list-repositories-in-domain \ --domaintest-domainOutput:
{ "repositories": [ { "name": "test-repo", "administratorAccount": "111122223333", "domainName": "test-domain", "domainOwner": "111122223333", "arn": "arn:aws:codeartifact:us-west-2:111122223333:repository/test-domain/test-repo", "description": "This is a test repository." }, { "name": "test-repo2", "administratorAccount": "111122223333", "domainName": "test-domain", "domainOwner": "111122223333", "arn": "arn:aws:codeartifact:us-west-2:111122223333:repository/test-domain/test-repo2", "description": "This is a test repository." } ] }For more information, see List repositories in the AWS CodeArtifact User Guide.
-
For API details, see ListRepositoriesInDomain
in AWS CLI Command Reference.
-
The following code example shows how to use list-repositories.
- AWS CLI
-
To list repositories
The following
list-repositoriesexample returns a summary of all repositories in domain owned by the AWS account that makes the call.aws codeartifact list-repositoriesOutput:
{ "repositories": [ { "name": "npm-store", "administratorAccount": "111122223333", "domainName": "my-domain", "domainOwner": "111122223333", "arn": "arn:aws:codeartifact:us-west-2:111122223333:repository/my-domain/npm-store", "description": "Provides npm artifacts from npm, Inc." }, { "name": "target-repo", "administratorAccount": "111122223333", "domainName": "my-domain", "domainOwner": "111122223333", "arn": "arn:aws:codeartifact:us-west-2:111122223333:repository/my-domain/target-repo", "description": "test target repo" }, { "name": "test-repo2", "administratorAccount": "111122223333", "domainName": "test-domain", "domainOwner": "111122223333", "arn": "arn:aws:codeartifact:us-west-2:111122223333:repository/test-domain/test-repo2", "description": "This is a test repository." } ] }For more information, see List repositories in the AWS CodeArtifact User Guide.
-
For API details, see ListRepositories
in AWS CLI Command Reference.
-
The following code example shows how to use login.
- AWS CLI
-
To configure authentication to your repository with the login command
The following
loginexample configures the npm package manager with a repository named test-repo in a domain named test-domain.aws codeartifact login \ --domaintest-domain\ --repositorytest-repo\ --toolnpmOutput:
Successfully configured npm to use AWS CodeArtifact repository https://test-domain-111122223333.d.codeartifact.us-west-2.amazonaws.com/npm/test-repo/ Login expires in 12 hours at 2020-11-12 01:53:16-05:00For more information, see Getting started with the AWS CLI in the AWS CodeArtifact User Guide.
-
For API details, see Login
in AWS CLI Command Reference.
-
The following code example shows how to use put-domain-permissions-policy.
- AWS CLI
-
To attach a permissions policy to a domain
The following
put-domain-permissions-policyexample attaches a permission policy that is defined in the policy.json file to a domain named test-domain.aws codeartifact put-domain-permissions-policy \ --domaintest-domain\ --policy-documentfile://PATH/TO/policy.jsonOutput:
{ "policy": { "resourceArn": "arn:aws:codeartifact:region-id:111122223333:domain/test-domain", "document": "{ ...policy document content...}", "revision": "MQlyyTQRASRU3HB58gBtSDHXG7Q3hvxxxxxxx=" } }For more information, see Set a domain policy in the AWS CodeArtifact User Guide.
-
For API details, see PutDomainPermissionsPolicy
in AWS CLI Command Reference.
-
The following code example shows how to use put-repository-permissions-policy.
- AWS CLI
-
To attach a permissions policy to a repository
The following
put-repository-permissions-policyexample attaches a permission policy that is defined in the policy.json file to a repository named test-repo.aws codeartifact put-repository-permissions-policy \ --domaintest-domain\ --repositorytest-repo\ --policy-documentfile://PATH/TO/policy.jsonOutput:
{ "policy": { "resourceArn": "arn:aws:codeartifact:region-id:111122223333:repository/test-domain/test-repo", "document": "{ ...policy document content...}", "revision": "MQlyyTQRASRU3HB58gBtSDHXG7Q3hvxxxxxxx=" } }For more information, see Set a policy in the AWS CodeArtifact User Guide.
-
For API details, see PutRepositoryPermissionsPolicy
in AWS CLI Command Reference.
-
The following code example shows how to use update-package-versions-status.
- AWS CLI
-
To update package version status
The following
update-package-versions-statusexample updates the status of version 4.0.0 of the test-package package to Archived.aws codeartifact update-package-versions-status \ --domaintest-domain\ --repotest-repo\ --formatnpm\ --packagetest-package\ --versions4.0.0\ --target-statusArchivedOutput:
{ "successfulVersions": { "4.0.0": { "revision": "Ciqe5/9yicvkJT13b5/LdLpCyE6fqA7poa9qp+FilPs=", "status": "Archived" } }, "failedVersions": {} }For more information, see Update package version status in the AWS CodeArtifact User Guide.
-
For API details, see UpdatePackageVersionsStatus
in AWS CLI Command Reference.
-
The following code example shows how to use update-repository.
- AWS CLI
-
To update a repository
The following
update-repositoryexample updates the description of a repo named test-repo in a domain named test-domain to "this is an updated description".aws codeartifact update-repository \ --domaintest-domain\ --repositorytest-repo\ --description"this is an updated description"Output:
{ "repository": { "name": "test-repo", "administratorAccount": "111122223333", "domainName": "test-domain", "domainOwner": "111122223333", "arn": "arn:aws:codeartifact:us-west-2:111122223333:repository/test-domain/test-repo", "description": "this is an updated description", "upstreams": [], "externalConnections": [] } }For more information, see View or modify a repository configuration in the AWS CodeArtifact User Guide.
-
For API details, see UpdateRepository
in AWS CLI Command Reference.
-