Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ingshtrom/80b6e65cd991c8d8e6b1ff87e2624c1a to your computer and use it in GitHub Desktop.
Save ingshtrom/80b6e65cd991c8d8e6b1ff87e2624c1a to your computer and use it in GitHub Desktop.
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