Skip to content

Instantly share code, notes, and snippets.

@p0bailey
Last active March 27, 2021 09:22
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save p0bailey/8f1f36117cf3aee9ced2c550a0668b29 to your computer and use it in GitHub Desktop.
Terraform Makefile
MAKEFLAGS += --silent
.PHONY: all init plan apply show destroy output graph
all:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
init: ## Initialize a new or existing Terraform configuration
terraform validate
terraform init
plan: ## Generate and show an execution plan.
terraform validate
terraform plan
apply: plan ## Builds or changes infrastructure.
terraform apply
show: ## Inspect Terraform state or plan.
terraform show
destroy: ## Destroy Terraform-managed infrastructure. BE CAREFUL!!!
terraform destroy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment