Created
January 23, 2017 10:02
-
-
Save michaelsauter/415d9d8c699ef59a85bf69bf05857b8f to your computer and use it in GitHub Desktop.
Terraform Makefile
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
check: | |
@terraform version | grep "Terraform v0\.8\.[0-9]*" >/dev/null; case $$? in \ | |
1) echo You need Terraform version 0.8.x!; exit 1;; \ | |
esac | |
config: check | |
@terraform remote config -backend=s3 -backend-config="bucket=xxx-terraform-state" -backend-config="key=yyy/terraform.tfstate" -backend-config="region=eu-central-1" | |
plan: config | |
@terraform plan -out terraform.tfplan | |
plan-apply: plan | |
@echo "" | |
@read -p "Apply plan? (y/n) " choice; \ | |
case "$$choice" in \ | |
y|Y ) terraform apply terraform.tfplan;; \ | |
* ) echo "Aborting.";; \ | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment