[ aws . codeartifact ]



Creates a domain. CodeArtifact domains make it easier to manage multiple repositories across an organization. You can use a domain to apply permissions across many repositories owned by different Amazon Web Services accounts. An asset is stored only once in a domain, even if it’s in multiple repositories.

Although you can have multiple domains, we recommend a single production domain that contains all published artifacts so that your development teams can find and share packages. You can use a second pre-production domain to test changes to the production domain configuration.

See also: AWS API Documentation

See ‘aws help’ for descriptions of global parameters.


--domain <value>
[--encryption-key <value>]
[--tags <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]


--domain (string)

The name of the domain to create. All domain names in an Amazon Web Services Region that are in the same Amazon Web Services account must be unique. The domain name is used as the prefix in DNS hostnames. Do not use sensitive information in a domain name because it is publicly discoverable.

--encryption-key (string)

The encryption key for the domain. This is used to encrypt content stored in a domain. An encryption key can be a key ID, a key Amazon Resource Name (ARN), a key alias, or a key alias ARN. To specify an encryptionKey , your IAM role must have kms:DescribeKey and kms:CreateGrant permissions on the encryption key that is used. For more information, see DescribeKey in the Key Management Service API Reference and Key Management Service API Permissions Reference in the Key Management Service Developer Guide .


CodeArtifact supports only symmetric CMKs. Do not associate an asymmetric CMK with your domain. For more information, see Using symmetric and asymmetric keys in the Key Management Service Developer Guide .

--tags (list)

One or more tag key-value pairs for the domain.


A tag is a key-value pair that can be used to manage, search for, or filter resources in CodeArtifact.

key -> (string)

The tag key.

value -> (string)

The tag value.

Shorthand Syntax:

key=string,value=string ...

JSON Syntax:

    "key": "string",
    "value": "string"

--cli-input-json | --cli-input-yaml (string) Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See ‘aws help’ for descriptions of global parameters.



To use the following examples, you must have the AWS CLI installed and configured. See the Getting started guide in the AWS CLI User Guide for more information.

Unless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to your terminal’s quoting rules. See Using quotation marks with strings in the AWS CLI User Guide .

To create a domain

The following create-domain example creates a domain named test-domain.

aws codeartifact create-domain \
    --domain test-domain


    "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.


domain -> (structure)

Contains information about the created domain after processing the request.

name -> (string)

The name of the domain.

owner -> (string)

The Amazon Web Services account ID that owns the domain.

arn -> (string)

The Amazon Resource Name (ARN) of the domain.

status -> (string)

The current status of a domain.

createdTime -> (timestamp)

A timestamp that represents the date and time the domain was created.

encryptionKey -> (string)

The ARN of an Key Management Service (KMS) key associated with a domain.

repositoryCount -> (integer)

The number of repositories in the domain.

assetSizeBytes -> (long)

The total size of all assets in the domain.

s3BucketArn -> (string)

The Amazon Resource Name (ARN) of the Amazon S3 bucket that is used to store package assets in the domain.