-
Notifications
You must be signed in to change notification settings - Fork 26
/
Makefile
64 lines (51 loc) · 1.97 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
.DEFAULT_GOAL := help
.PHONY: help
help:
less ./README.md
.PHONY: tfvars
tfvars:
cp ./terraform.tfvars.example terraform.tfvars
.PHONY: init
init:
terraform init -upgrade
.PHONY: create
create: init
terraform plan -out aro.plan \
-var "subscription_id=$(shell az account show --query id --output tsv)" \
-var "cluster_name=aro-$(shell whoami)" \
-var "aro_version=$(shell az aro get-versions -l eastus --query '[-1]' | sed 's/"//g')"
terraform apply aro.plan
.PHONY: create-private
create-private: init
terraform plan -out aro.plan \
-var "cluster_name=aro-$(shell whoami)" \
-var "restrict_egress_traffic=true" \
-var "api_server_profile=Private" \
-var "ingress_profile=Private" \
-var "outbound_type=UserDefinedRouting" \
-var "subscription_id=$(shell az account show --query id --output tsv)" \
-var "aro_version=$(shell az aro get-versions -l eastus --query '[-1]' | sed 's/"//g')" \
-var "acr_private=false"
terraform apply aro.plan
.PHONY: create-private-noegress
create-private-noegress: init
terraform plan -out aro.plan \
-var "cluster_name=aro-$(shell whoami)" \
-var "restrict_egress_traffic=false" \
-var "api_server_profile=Private" \
-var "ingress_profile=Private" \
-var "aro_version=$(shell az aro get-versions -l eastus --query '[-1]' | sed 's/"//g')" \
-var "subscription_id=$(shell az account show --query id --output tsv)"
terraform apply aro.plan
.PHONY: destroy
destroy:
terraform destroy -var "subscription_id=$(shell az account show --query id --output tsv)"
.PHONY: destroy.force
destroy.force:
terraform destroy -auto-approve -var "subscription_id=$(shell az account show --query id --output tsv)"
.PHONY: delete
delete: destroy
.PHONY: clean
clean:
rm -rf terraform.tfstate*
rm -rf .terraform*