-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuildspec.yaml
30 lines (27 loc) · 1.17 KB
/
buildspec.yaml
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
30
# Copyright © 2022 Amazon Web Services, Inc. or its affiliates. All Rights Reserved. This AWS Content is provided subject to the terms of the AWS Customer Agreement available at http://aws.amazon.com/agreement or other written agreement between Customer and either Amazon Web Services, Inc. or Amazon Web Services EMEA SARL or both."
# CodeBuild buildspec file for killing/reviving the MWAA env via Terraform
version: 0.2
env:
shell: bash
parameter-store:
TF_INIT: "${TF_INIT_COMMAND_SSM_NAME}"
TF_APPLY: "${TF_APPLY_COMMAND_SSM_NAME}"
TERRAFORM_VERSION: "${TERRAFORM_VERSION_SSM_NAME}"
phases:
install:
runtime-versions:
python: 3.8
commands:
- cd /tmp
- echo "Installing Terraform"
- curl -o terraform_${TERRAFORM_VERSION}_linux_amd64.zip https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip
- unzip -o terraform_${TERRAFORM_VERSION}_linux_amd64.zip && mv terraform /usr/bin
- terraform --version
build:
commands:
- cd ${CODEBUILD_SRC_DIR}
- bash -c "${TF_INIT}"
- bash -c "${TF_APPLY}"
post_build:
commands:
- echo Switch completed on `date`