Skip to content

Instantly share code, notes, and snippets.

@nicerobot
Created August 21, 2020 01:38
Show Gist options
  • Save nicerobot/ca030d481c216a96fa6fa19600c2e088 to your computer and use it in GitHub Desktop.
Save nicerobot/ca030d481c216a96fa6fa19600c2e088 to your computer and use it in GitHub Desktop.
A Makefile for Terraform
.PRECIOUS: output.json terraform.tfplan terraform.tfstate
output.json: terraform.tfstate
terraform output -no-color -json | tee $@
plan: terraform.tfplan
terraform.tfplan:
terraform plan -out $@
terraform.tfstate: terraform.tfplan
terraform apply $^
apply: terraform.tfstate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment