-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.terraform
41 lines (33 loc) · 1.02 KB
/
Makefile.terraform
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
# Initialize all terraform plugins and modules
terraform-init:
@terraform init
# Format all files with .tf extension in the working directory
terraform-format: ## Show environment variables
@for file in $(TERRAFORM_FILES) ; do \
terraform fmt $$file ; \
done
# Print out the blueprint of the resources which will be created
terraform-plan: terraform-init
@terraform plan
# Apply terraform and create the actual resources
terraform-apply: terraform-plan
@terraform apply -auto-approve
# Destroy resources created by terraform
terraform-destroy: terraform-init
@terraform destroy -input=false -auto-approve
# Validate terraform files
terraform-validate: terraform-init
@terraform validate
# Lint files with `.tf` extension
terraform-fmt-check: terraform-init
@for file in $(TERRAFORM_FILES) ; do \
@terraform fmt -check
done
# Print current terraform version
terraform-version:
@terraform --version
# Remove extra files generated by terraform
terraform-clean:
@for file in $(CLEAN_UP_FILES) ; do \
rm -rf $$file ; \
done