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.
This module deploys Terraform-managed AWS CodeBuild.
Author: Tony Vattahil ([email protected])
- Install Terraform. See Install Terraform for a tutorial.
- Sign up and log into Terraform Cloud. There is a free tier available.
-
Generate a Terraform Cloud token.
terraform login
-
Export the
TERRAFORM_CONFIG
variable.
export TERRAFORM_CONFIG="$HOME/.terraform.d/credentials.tfrc.json"
Example file path
$HOME/.aws/terraform.tfvars
Example .tfvars file contents
Replace the sample values in the example with your own values.
AWS_SECRET_ACCESS_KEY = "<AKIAIOSFODNN7EXAMPLE>"
AWS_ACCESS_KEY_ID = "<wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY>"
AWS_SESSION_TOKEN = "AQoDYXdzEJr...<remainder of security token>"
Note: STS-based credentials are optional but highly recommended.
WARNING: Make sure your credentials are secured outside of version control and follow secrets-management best practices.
-
Clone the aws-ia/terraform-aws-codebuild repository.
git clone https://github.com/aws-ia/terraform-aws-codebuild
-
Change to the module root directory.
cd terraform-aws-codebuild
-
Set up your Terraform cloud workspace.
cd setup_workspace
-
Run the following commands in order:
terraform init
terraform apply
orterraform apply -var-file="$HOME/.aws/terraform.tfvars"
.Note: Terraform apply runs remotely in Terraform Cloud.
-
Change to the deploy directory.
cd ../deploy
-
Open dev.auto.tfvars and edit the default values to suit your environment.