Skip to content
main
Switch branches/tags
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Note: This module is in alpha state and is likely to contain bugs and updates may introduce breaking changes. It is not recommended for production use at this time.

Terraform AWS CodeCommit

This module deploys Terraform-managed AWS CodeCommit.

Author: Tony Vattahil (tonynv@amazon.com)

Install Terraform

To deploy this module you must install Terraform. See Install Terraform for a tutorial.

Sign up for Terraform Cloud

Sign up and log into Terraform Cloud. (There is a free tier available.)

Configure Terraform Cloud API Access

Generate a Terraform Cloud token.

terraform login

Export the TERRAFORM_CONFIG variable.

export TERRAFORM_CONFIG="$HOME/.terraform.d/credentials.tfrc.json"

Configure your tfvars file

Example filepath = $HOME/.aws/terraform.tfvars

Example tfvars file contents

In the example, replace *** with your AKEY and SKEY.

AWS_SECRET_ACCESS_KEY = "*****************"
AWS_ACCESS_KEY_ID = "*****************"
AWS_SESSION_TOKEN = "*****************"

Note: STS-based credentials are optional but highly recommended.

!!!!CAUTION!!!!: Make sure your credentials are secured outside of version control and follow secrets-management best practices.

Deploy the module (Linux or Mac)

Clone the aws-ia/terraform-aws-codecommit repository.

git clone https://github.com/aws-ia/terraform-aws-codecommit

Change directory to the root directory.

cd terraform-aws-codecommit/

Change to the deploy directory.

cd setup_workspace.

Run to following commands in order:

terraform init

terraform apply or terraform apply -var-file="$HOME/.aws/terraform.tfvars".

Change directory to the deploy directory. (The previous command automatically generates backend.hcl.)

cd ../deploy

terraform apply or terraform apply -var-file="$HOME/.aws/terraform.tfvars".

Terraform apply is run remotely in Terraform Cloud.