Created
October 6, 2017 13:50
-
-
Save ingshtrom/80b6e65cd991c8d8e6b1ff87e2624c1a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 0.2 | |
env: | |
variables: | |
TerraformVersion: 0.10.7 | |
phases: | |
install: | |
commands: | |
# workaround for auth for s3 backend, since the aws provider hasn't initialized yet | |
- apt-get update -y | |
- apt-get install -y jq | |
- creds_output=$(curl 169.254.170.2$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI) | |
- AWS_ACCESS_KEY_ID=$(echo $creds_output | jq --raw-output .AccessKeyId) | |
- AWS_SECRET_ACCESS_KEY=$(echo $creds_output | jq --raw-output .SecretAccessKey) | |
- AWS_SESSION_TOKEN=$(echo $creds_output | jq --raw-output .Token) | |
- AWS_DEFAULT_REGION=us-east-2 | |
- echo $creds_output | |
- echo $AWS_ACCESS_KEY_ID | |
- echo $AWS_SECRET_ACCESS_KEY | |
- echo $AWS_SESSION_TOKEN | |
- echo $AWS_DEFAULT_REGION | |
# install terraform | |
- cd /tmp | |
- curl -o terraform.zip https://releases.hashicorp.com/terraform/${TerraformVersion}/terraform_${TerraformVersion}_linux_amd64.zip | |
- unzip terraform.zip | |
- mv terraform /usr/bin | |
- cd - | |
build: | |
commands: | |
- cd ./aws/terraform | |
- terraform init -no-color | |
- terraform validate -no-color |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment