-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildspec.yml
27 lines (27 loc) · 1.07 KB
/
buildspec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
version: 0.2
phases:
install:
commands:
# Install terraform
- cd /tmp
- curl -o terraform.zip https://releases.hashicorp.com/terraform/${TerraformVersion}/terraform_${TerraformVersion}_linux_amd64.zip
- echo "${TerraformSha256} terraform.zip" | sha256sum -c --quiet
- unzip terraform.zip && mv terraform /usr/bin
# Install terragrunt
- curl -Lo terragrunt https://github.com/gruntwork-io/terragrunt/releases/download/${TerragruntVersion}/terragrunt_linux_amd64
- echo "${TerragruntSha256} terragrunt" | sha256sum -c --quiet
- chmod +x terragrunt
- mv terragrunt /usr/bin
build:
commands:
# Used by terragrunt config files to determin env vars.
- SR_TF_ENV=${Environment}
# Deploy module from env var.
- cd ${CODEBUILD_SRC_DIR}/live/${TfTargetDir}
# Select environment workspaces.
- terragrunt workspace new ${Environment} || true
- terragrunt workspace select ${Environment}
# Apply changes.
- terragrunt init
- terragrunt plan
- terragrunt apply -auto-approve