Created
October 31, 2020 08:17
-
-
Save amacal/5dc3e74bf9fd25f31165c29507beb285 to your computer and use it in GitHub Desktop.
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
PLAN_NAME := booking-system | |
LOCKS_TABLE := terraform-locks | |
REGION_NAME := eu-west-1 | |
BUCKET_NAME := terraform-state-$(shell aws sts get-caller-identity --query Account --output text) | |
init: | |
@terraform init \ | |
-backend-config="region=$(REGION_NAME)" \ | |
-backend-config="bucket=$(BUCKET_NAME)" \ | |
-backend-config="dynamodb_table=$(LOCKS_TABLE)" \ | |
-backend-config="key=$(PLAN_NAME)/$(REGION_NAME).tfstate" \ | |
-reconfigure -upgrade | |
plan: | |
@terraform plan \ | |
-var 'region=$(REGION_NAME)' \ | |
-var 'plan_name=$(PLAN_NAME)' | |
apply: | |
@terraform apply -auto-approve \ | |
-var 'region=$(REGION_NAME)' \ | |
-var 'plan_name=$(PLAN_NAME)' | |
destroy: | |
@terraform destroy \ | |
-var 'region=$(REGION_NAME)' \ | |
-var 'plan_name=$(PLAN_NAME)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment