Skip to content

Instantly share code, notes, and snippets.

@DeviaVir
Created April 21, 2017 23:50
Show Gist options
  • Select an option

  • Save DeviaVir/7582026ab0eb3ee01180622476f7c00a to your computer and use it in GitHub Desktop.

Select an option

Save DeviaVir/7582026ab0eb3ee01180622476f7c00a to your computer and use it in GitHub Desktop.
Terraform
SHELL=/bin/bash
REGION?="us-west-2"
prepare:
$(eval AWS=$(shell echo pass hashbang/aws/terraform))
$(eval AAK=$(shell $(AWS) | sed -n 1p))
$(eval ASK=$(shell $(AWS) | sed -n 2p))
get:
terraform get
init:
terraform init
terraform: prepare
terraform ${MAKECMDGOALS} --var "region=${REGION}" --var "aws_access_key=${AAK}" --var "aws_secret_key=${ASK}"
plan: get terraform
apply: get terraform
.PHONY: init plan apply
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment