AWS CodeArtifact Domain
This page shows how to write Terraform and CloudFormation for CodeArtifact Domain and write them securely.
aws_codeartifact_domain (Terraform)
The Domain in CodeArtifact can be configured in Terraform with the resource name aws_codeartifact_domain
. The following sections describe 5 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_codeartifact_domain" "domain" {
domain = var.domain
encryption_key = var.kms_key_arn
tags = var.tags
}
resource "aws_codeartifact_domain" "test" {
encryption_key = aws_kms_key.test.arn
resource "aws_codeartifact_domain" "my_domain" {
domain = "my-domain"
encryption_key = aws_kms_key.code_artifact_encryption_key.arn
}
resource "aws_codeartifact_repository" "my_repo_1" {
resource "aws_codeartifact_domain" "codeartifact_domain" {
domain = var.codeartifact_domain
encryption_key = aws_kms_key.codeartifact_key.arn
}
resource "aws_codeartifact_repository" "codeartifact_upstream" {
repository = var.codeartifact_upstream
resource "aws_codeartifact_domain" "examplea" {
domain = var.domain
tags = var.common_tags
}
Parameters
-
arn
optional computed - string -
asset_size_bytes
optional computed - number -
created_time
optional computed - string -
domain
required - string -
encryption_key
optional computed - string -
id
optional computed - string -
owner
optional computed - string -
repository_count
optional computed - number -
tags
optional - map from string to string
Explanation in Terraform Registry
Provides a CodeArtifact Domain Resource.
AWS::CodeArtifact::Domain (CloudFormation)
The Domain in CodeArtifact can be configured in CloudFormation with the resource name AWS::CodeArtifact::Domain
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
DomainName
required - String -
EncryptionKey
optional - String -
PermissionsPolicyDocument
optional - Json -
Tags
optional - List of Tag
Explanation in CloudFormation Registry
The
AWS::CodeArtifact::Domain
resource creates an AWS CodeArtifact 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 AWS accounts. For more information about domains, see the Domain concepts information in the CodeArtifact User Guide. For more information about theCreateDomain
API, see CreateDomain in the CodeArtifact API Reference.
Frequently asked questions
What is AWS CodeArtifact Domain?
AWS CodeArtifact Domain is a resource for CodeArtifact of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS CodeArtifact Domain?
For Terraform, the shepherd44/terraform-aws-codeartifact, JamesWoolfenden/check-encrypt and aws-samples/codeartifact-retention-policy source code examples are useful. See the Terraform Example section for further details.