Terraform-IaC/Makefile
oscarpocock d994b5d850
Some checks failed
ci/woodpecker/push/deploy Pipeline was successful
ci/woodpecker/manual/deploy Pipeline failed
Added variables for secrets
2022-12-03 04:03:46 +00:00

28 lines
No EOL
775 B
Makefile

CODE_PATH ?= .
HETZNERKEY ?= .
B2ACCESS ?= .
B2SECRET ?= .
init:
@cd $(CODE_PATH) && terraform init -reconfigure -upgrade -backend-config="access_key=$(B2ACCESS)" -backend-config="secret_key=$(B2SECRET)"
plan: init validate
@cd $(CODE_PATH) && terraform plan -var="hcloud_token=$(HETZNERKEY)"
apply: init validate
@cd $(CODE_PATH) && terraform apply --auto-approve -var="hcloud_token=$(HETZNERKEY)"
refresh: init validate
@cd $(CODE_PATH) && terraform refresh -var="hcloud_token=$(HETZNERKEY)"
fmt:
@cd $(CODE_PATH) && terraform fmt -check -recursive
validate:
@cd $(CODE_PATH) && terraform validate
output: init
@cd $(CODE_PATH) && terraform output
destroy: init validate
@cd $(CODE_PATH) && terraform destroy --auto-approve -var="hcloud_token=$(HETZNERKEY)"