Resource: aws_codecommit_repository

Provides a CodeCommit Repository Resource.

Example Usage

resource "aws_codecommit_repository" "test" {
  repository_name = "MyTestRepository"
  description     = "This is the Sample App Repository"
}

AWS KMS Customer Managed Keys (CMK)

resource "aws_codecommit_repository" "test" {
  repository_name = "MyTestRepository"
  description     = "This is the Sample App Repository"
  kms_key_id      = aws_kms_key.test.arn
}

resource "aws_kms_key" "test" {
  description             = "test"
  deletion_window_in_days = 7
}

Argument Reference

This resource supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import CodeCommit repository using repository name. For example:

import {
  to = aws_codecommit_repository.imported
  id = "ExistingRepo"
}

Using terraform import, import CodeCommit repository using repository name. For example:

% terraform import aws_codecommit_repository.imported ExistingRepo