/terraform-aws-codecommit

Terraform module to create codecommit repositories

Primary LanguageHCL

Codecommit AWS module

Simple repo:

  module "simple" {
    source  = "tokarev-artem/codecommit/aws"

    repository_name = "react"
    description     = "Frontend app"

    tags = {
      Role = "frontend"
    }
  }

Multiple repositories:

  module "multiple" {
    for_each = {
      frontend-react = {
        description = "react app"
      }
      backend-typescript = {
        description = "backend app"
      }
    }
    source          = "tokarev-artem/codecommit/aws"
    repository_name = each.key
    description     = each.value.description
    kms_key_id      = "arn:aws:kms:eu-central-1:1234567891011:key/cb121336-dddd-4a0d-abcd-914f5d2c2e2a"

    rule_template_description       = "Approval rule template for pull requests"
    rule_number_of_approvals_needed = 2
    rule_approval_pool_members      = ["arn:aws:iam::1234567891011:user/JohnSnow"]
    rule_destination_refs           = ["refs/heads/main", "refs/heads/dev"]

    trigger_destination_arn = "arn:aws:sns:eu-central-1:1234567891011:test-topic"
    trigger_custom_data     = "Custom data for the trigger"
    trigger_events          = ["updateReference", "createReference"]
    trigger_branches        = ["dev", "main"]

    tags = {
      ownder = "horns-and-hoofs"
    }
  }

Providers

Name Version
aws n/a

Inputs

Name Description Type Default Required
repository_name The name of the CodeCommit repository string n/a yes
approval_rule_branch_name A branch name to apply approval rule to string "main" no
default_branch The default branch of the repository. The branch specified here needs to exist. string "main" no
description The description of the CodeCommit repository string "" no
kms_key_id The ARN of the encryption key. If no key is specified, the default aws/codecommit Amazon Web Services managed key is used. string null no
rule_approval_pool_members The list of ARNs for users or groups who can approve pull requests list(string) [] no
rule_destination_refs List of destination references for the approval rule template list(string)
[
"refs/heads/main"
]
no
rule_number_of_approvals_needed The number of approvals needed for a pull request number "1" no
rule_template_description The description of the approval rule template string "" no
tags A map of tags to assign to the resource map(string) {} no
trigger_branches The branches that will be included in the trigger configuration. If no branches are specified, the trigger will apply to all branches. list(any) [] no
trigger_custom_data Any custom data associated with the trigger string "" no
trigger_destination_arn The ARN of the resource that is the target of the trigger string null no
trigger_events The events that will trigger the action (e.g., all, updateReference, createReference, deleteReference) list(string)
[
"all"
]
no
trigger_name The name of the trigger string null no

Outputs

Name Description
approval_rule_template_id ID of the approval rule template
approval_rule_template_name Name of the approval rule template
repository_arn ARN of the CodeCommit repository
repository_clone_url_http HTTP clone URL of the CodeCommit repository
repository_clone_url_ssh SSH clone URL of the CodeCommit repository
repository_name Name of the CodeCommit repository
trigger_id ID of the CodeCommit trigger