-
Notifications
You must be signed in to change notification settings - Fork 6
/
buildspec.yml
29 lines (25 loc) · 1.46 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
28
29
version: 0.2
phases:
install:
runtime-versions:
python: 3.7
commands:
- echo "Installing terraform"
- "cd /usr/bin"
- "curl -s -qL -o terraform.zip https://releases.hashicorp.com/terraform/0.12.24/terraform_0.12.24_linux_amd64.zip"
- "unzip -o terraform.zip"
- terraform -version
build:
commands:
- echo Processing shared resources
- cd $CODEBUILD_SRC_DIR/terraform && terraform init --backend-config="key=cluster" -backend-config="bucket=$STATE_BUCKET_NAME"
- cd $CODEBUILD_SRC_DIR/terraform && terraform plan -out plan -var-file default.tfvars
- cd $CODEBUILD_SRC_DIR/terraform && terraform apply plan
- echo Creating Response api
- cd $CODEBUILD_SRC_DIR/terraform/ecs_service && terraform init --backend-config="key=response-app-api" -backend-config="bucket=$STATE_BUCKET_NAME"
- cd $CODEBUILD_SRC_DIR/terraform/ecs_service && terraform plan -out plan -var-file response-app.tfvars
- cd $CODEBUILD_SRC_DIR/terraform/ecs_service && terraform apply plan
- echo Creating Response UI
- cd $CODEBUILD_SRC_DIR/terraform/ecs_service && terraform init --backend-config="region=$AWS_REGION" --backend-config="key=response-ui" -backend-config="bucket=$STATE_BUCKET_NAME"
- cd $CODEBUILD_SRC_DIR/terraform/ecs_service && terraform plan -out plan -var region=$AWS_REGION -var-file response-app.tfvars
- cd $CODEBUILD_SRC_DIR/terraform/ecs_service && terraform apply plan