This template creates an AWS CodeCommit repository and associates it with AWS CodeGuru Reviewer using a customer-managed CMK for encryption.

Terraform Template

resource "aws_codecommit_repository" "example" {

  lifecycle {
    ignore_changes = ["tags["codeguru-reviewer"]"]
  }
  repository_name = "example-repo"
}

resource "aws_codegurureviewer_repository_association" "example" {

  kms_key_details {
    encryption_option = "CUSTOMER_MANAGED_CMK"
    kms_key_id = aws_kms_key.example.key_id
  }
}

resource "aws_kms_key" "example" {
}