# 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`