-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
46 lines (37 loc) · 1.42 KB
/
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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
.EXPORT_ALL_VARIABLES:
AWS_PAGER = ""
all: check init plan deploy
@echo "\n>>>>> Done!"
commit: check init format
@echo "\n>>>>> Done!"
setup: check init format
@echo "\n>>>>> Done!"
cd setup; ./setup-eks.sh
check:
@echo "\n>>>>> Check environment"
terraform --version >/dev/null 2>&1 || { echo >&2 "I require Terraform but it's not installed. ¯\_(ツ)_/¯ Aborting."; exit 1; }
aws --version >/dev/null 2>&1 || { echo >&2 "I require Terraform but it's not installed. ¯\_(ツ)_/¯ Aborting."; exit 1; }
jq --version >/dev/null 2>&1 || { echo >&2 "I require jq utility but it's not installed. ¯\_(ツ)_/¯ Aborting."; exit 1; }
aws sts get-caller-identity --no-paginate
init:
@echo "\n>>>>> Initialize Terraform"
terraform --version
cd IaC; terraform init -input=false
cd iac; terraform validate
plan:
@echo "\n>>>>> terraform plan"
cd IaC; terraform validate
cd IaC; terraform plan -lock=false -input=false
deploy:
@echo "\n>>>>> Deploying solution"
cd IaC; terraform plan -lock=false -input=false
cd IaC; terraform apply -auto-approve -input=false
format:
@echo "\n>>>>> terraform prepare for commit"
cd IaC; terraform validate
cd IaC; terraform fmt -recursive
destroy:
@echo "\n>>>>> Cleanup solution"
cd IaC; terraform destroy -target=module.kubernetes_addons -auto-approve
cd IaC; terraform destroy -target=module.eks_blueprints -auto-approve
cd IaC; terraform destroy -auto-approve