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β
| Name | Type | Description |
|---|---|---|
region | string | AWS region to deploy the CodeArtifact domain |
domain_name | string | Name of the CodeArtifact domain |
environment | string | Tag to specify the deployment environment (e.g., dev) |
π€ Outputsβ
| Name | Description |
|---|---|
codeartifact_domain_arn | The ARN of the created CodeArtifact domain |
domain_name | The name of the CodeArtifact domain |
owner_account_id | The 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.