Skip to main content

CodeCommit Repository

πŸ“¦ Overview​

This Terraform module provisions a private AWS CodeCommit Git repository, giving your team secure, AWS-native source control that integrates seamlessly with your cloud infrastructure.

It’s ideal for managing infrastructure as code, internal tools, and application source code in a secure, centralized Git environment.


βœ… Key Features​

  • Creates a fully managed, private AWS CodeCommit repository
  • Supports custom repository names and descriptions
  • Enables tagging for environment, owner, or application grouping
  • Designed for secure Git-based collaboration inside AWS

πŸ’Ό Use Cases​

  • Hosting Terraform, CloudFormation, or other infrastructure code
  • Internal tooling and microservices codebases
  • Source control for serverless apps or container configs
  • Pipelines that require Git-hosted triggers inside AWS

πŸ“₯ Input Variables​

NameTypeDescription
regionstringAWS region to deploy the CodeCommit repository
repository_namestringThe name of the CodeCommit repository
descriptionstring(Optional) Description of the repository
environmentstringTag to specify the deployment environment (e.g., dev, staging)

πŸ“€ Outputs​

NameDescription
repository_nameThe name of the created CodeCommit repository
repository_clone_url_httpThe HTTP clone URL for the repository
repository_clone_url_sshThe SSH clone URL for the repository

πŸš€ Deployment Readiness​

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

πŸ› οΈ Example Usage​

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

region = "us-east-1"
repository_name = "my-private-repo"
description = "Infrastructure code for internal projects"
environment = "dev"
}
terraform init
terraform plan
terraform apply

or

or

tofu init
tofu plan
tofu apply

🧹 Cleanup Options​

For testing:

terraform destroy

or

tofu destroy

For production:

Manually delete the repository via the AWS Console or CLI if it's integrated with automation workflows or shared with other teams.

πŸ›‘οΈ Notes​

This is a Level 1 developer utility module for creating private CodeCommit repositories. For CI/CD automation, permission boundaries, or workflow orchestration, pair this with modules for IAM policies, CodeBuild, or CodePipeline.

πŸ”’ 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.