Skip to content

Instantly share code, notes, and snippets.

@egarbi egarbi/Makefile

Created Jun 7, 2016
Embed
What would you like to do?
Multienvironment Makefile
.PHONY: all-test plan-test apply-test destroy-test all-prod plan-prod apply-prod destroy-prod
all-test: plan-test apply-test
all-prod: plan-prod apply-prod
plan-test:
terraform plan -var 'env=testing' -var-file terraform.tfvars -out terraform.tfplan.test -state=terraform.tfstate.test -input=true
plan-prod:
terraform plan -var 'env=prod' -var-file terraform.tfvars -out terraform.tfplan.prod -state=terraform.tfstate.prod -input=true
apply-test:
terraform apply -state=terraform.tfstate.test terraform.tfplan.test
apply-prod:
terraform apply -state=terraform.tfstate.prod terraform.tfplan.prod
destroy-test:
terraform plan -var 'env=testing' -destroy -var-file terraform.tfvars -out terraform.tfplan.test -state=terraform.tfstate.test
destroy-prod:
terraform plan -var 'env=prod' -destroy -var-file terraform.tfvars -out terraform.tfplan.prod -state=terraform.tfstate.prod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.