Skip to main content

CodeArtifact Domain

πŸ“¦ Overview​

This Terraform module provisions an AWS CodeArtifact domain, enabling centralized management of private package repositories within your AWS environment.

It serves as the foundational component for organizations looking to standardize internal dependency distribution and governance.


βœ… Key Features​

  • Creates a centralized CodeArtifact domain in a specified region
  • Supports multiple repositories under a single domain
  • Enables cross-team sharing and access control
  • Prepares your environment for secure and scalable package management

πŸ’Ό Use Cases​

  • Organizations centralizing private dependency management
  • CI/CD workflows that publish or consume internal packages
  • Teams building microservices that share common libraries
  • Enterprises enforcing software provenance and code trust

πŸ“₯ Input Variables​

NameTypeDescription
regionstringAWS region to deploy the CodeArtifact domain
domain_namestringName of the CodeArtifact domain
environmentstringTag to specify the deployment environment (e.g., dev)

πŸ“€ Outputs​

NameDescription
codeartifact_domain_arnThe ARN of the created CodeArtifact domain
domain_nameThe name of the CodeArtifact domain
owner_account_idThe AWS account ID that owns the domain

πŸš€ Deployment Readiness​

  • βœ… Compatible with Terraform 1.0+
  • βœ… Tested with AWS provider 5.x
  • πŸ§ͺ Requires IAM permissions to manage CodeArtifact resources

πŸ› οΈ Example Usage​

module "codeartifact_domain" {
source = "git::ssh://git@github.com/archiphire/aws-level-1-modules.git//developer-utilities/codeartifact-domain?ref=v1.0.0"

region = "us-east-1"
domain_name = "my-org-domain"
environment = "dev"
}
terraform init
terraform plan
terraform apply

or

tofu init
tofu plan
tofu apply

🧹 Cleanup Options​

For testing:

terraform destroy

or

tofu destroy

For production:

Manually delete the CodeArtifact domain via the AWS Console or CLI if it’s integrated with repositories or pipelines to avoid breaking workflows.

πŸ›‘οΈ Notes​

This is a Level 1 module intended to bootstrap an AWS CodeArtifact domain. To build a full system, pair this with additional modules for repository creation, upstream config, and CI/CD access token management.

πŸ”’ Deployment Package Notice​

This module is part of the Level 1 AWS License Tier. To access the full deployment package and source code, subscribe to Archiphire.