Terraform module to create AWS CodeCommit repositories. AWS CodeCommit is a fully-managed source control service that hosts secure Git-based repositories.
You can use this module to create an AWS CodeCommit repositories using few parameters (simple example) or define in detail every aspect of the repositories (complete example).
Check the examples for the simple and the complete snippets.
This example creates an CodeCommit repository using few parameters
module "codecommit" {
source = "lgallard/codecommit/aws"
repository_name = "codecommit-repo"
description = "Git repositoriy in AWS"
tags = {
Owner = "DevOps team"
Environment = "dev"
Terraform = true
}
}
In this example the repository is defined in detailed.
module "codecommit" {
source = "lgallard/codecommit/aws"
repository_name = "codecommit-repo"
description = "Git repositoriy in AWS"
default_branch = "master"
triggers = [
{
name = "all"
events = ["all"]
destination_arn = "arn:aws:lambda:us-east-1:12345678910:function:lambda-all"
},
{
name = "updateReference"
events = ["updateReference"]
destination_arn = "arn:aws:lambda:us-east-1:12345678910:function:lambda-updateReference"
},
]
tags = {
Owner = "DevOps team"
Environment = "dev"
Terraform = true
}
}
Name | Version |
---|---|
aws | n/a |
Name | Description | Type | Default | Required |
---|---|---|---|---|
default_branch | The default branch of the repository. The branch specified here needs to exist. | string |
n/a | yes |
description | The description of the repository. This needs to be less than 1000 characters | string |
n/a | yes |
repository_name | The name for the repository. This needs to be less than 100 characters. | string |
n/a | yes |
tags | A mapping of tags to assign to the resource. | map(string) |
{} |
no |
triggers | List of triggers | any |
[] |
no |
Name | Description |
---|---|
arn | The ARN of the repository |
clone_url_http | The URL to use for cloning the repository over HTTPS. |
clone_url_ssh | The URL to use for cloning the repository over SSH. |
name | The name for the repository |
repository_id | The ID of the repository |
During the developing of the module I found an issue when trying to create several triggers for a repository. This is an issue reported inr the AWS provider at Multiple codecommit triggers