-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
24 lines (17 loc) · 859 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.PHONY: staging production
#TO DO: Ideally these states should be saved in Admin account and need to think of a way to do it
STAGING_TF_STATE="staging.tfstate" #Change that to http://staging.infrastructure.s3.amazonaws.com later
PRODUCTION_TF_STATE="production.tfstate" #Change that to http://staging.infrastructure.s3.amazonaws.com later
prereqs:
which terraform
#init: pre-reqs
# export AWS_PROFILE=dev && terraform init
staging: prereqs staging.tfvars .terraform
terraform plan -var-file=staging.tfvars -state=${STAGING_TF_STATE}
terraform apply -var-file=staging.tfvars -state=${STAGING_TF_STATE} --auto-approve
production: terraform production.tfvars
terraform plan -var-file=production.tfvars -state=${PRODUCTION_TF_STATE}
staging_destroy:
terraform destroy -var-file=staging.tfvars -state=staging.tfstate --auto-approve
test:
@echo Hello