LinuxCommandLibrary

aws-codeartifact

Interact with AWS CodeArtifact repositories

TLDR

List available domains for your AWS account

$ aws codeartifact list-domains
copy

Generate credentials for a specific package manager
$ aws codeartifact login --tool [npm|pip|twine] --domain [your_domain] --repository [repository_name]
copy

Get the endpoint URL of a CodeArtifact repository
$ aws codeartifact get-repository-endpoint --domain [your_domain] --repository [repository_name] --format [npm|pypi|maven|nuget|generic]
copy

Display help
$ aws codeartifact help
copy

Display help for a specific subcommand
$ aws codeartifact [subcommand] help
copy

SYNOPSIS

aws codeartifact SUBCOMMAND [global-options] [subcommand-options] [arguments]

PARAMETERS

--debug
    Enable debug logging.

--endpoint-url TEXT
    Override default service endpoint URL.

--no-verify-ssl
    Disable SSL certificate verification.

--no-paginate
    Disable automatic pagination.

--output TEXT
    Output format: json|text|table.

--query TEXT
    JMESPath expression to filter output.

--profile TEXT
    Use specific AWS credentials profile.

--region TEXT
    AWS Region (e.g., us-east-1).

--version
    Show version and exit.

--color TEXT
    Control colored output: on|off|auto.

--cli-auto-prompt
    Automatically prompt for missing CLI args.

DESCRIPTION

The aws codeartifact command is a component of the AWS Command Line Interface (CLI) used to interact with Amazon CodeArtifact, a fully managed artifact repository service. It allows secure storage, publishing, and consumption of software packages in formats like npm, Maven, Gradle, pip, NuGet, and generic repositories.

Key capabilities include creating and managing domains (top-level groupings) and repositories (package stores), associating external connections to public repos like Maven Central or npmjs, uploading/downloading package versions, listing and disposing packages, generating authorization tokens for access, and setting repository policies with IAM integration. It supports CI/CD workflows, VPC endpoints for private connectivity, and encryption at rest/transit.

Usage requires AWS CLI v2 installed and configured with credentials (access keys, IAM roles, or SSO). Run aws codeartifact help for subcommands. Ideal for teams standardizing artifact management across languages and reducing external dependencies.

CAVEATS

Requires AWS CLI v2 and valid credentials. CodeArtifact availability limited to specific regions. High-frequency API calls may hit throttling limits; use exponential backoff.

KEY SUBCOMMANDS

login: Configure package managers (npm, pip, Maven).
get-authorization-token: Obtain repo access token.
create-domain / create-repository: Set up resources.
put-repository-permissions-policy: Manage access.

USAGE EXAMPLE

aws codeartifact login --tool npm --domain mydomain --repository myrepo --region us-east-1
Configures ~/.npmrc for authenticated pulls.

HISTORY

Launched October 8, 2020, with AWS CLI v2 support. Evolved with added formats (e.g., Swift Package Manager in 2022) and features like multi-format repos.

SEE ALSO

aws(1), npm(1), pip(1), mvn(1)

Copied to clipboard