Compare commits

..

No commits in common. "9192879c03bb177fc1df3707c6c3b03ed782ecd1" and "b51617c009669cdf97b0828b17ca2773928a4def" have entirely different histories.

View File

@ -1,23 +1,26 @@
.PHONY: init plan apply format
# Define vault_env function to set up vault environment
define vault_env
@export VAULT_ADDR="https://vault.service.consul:8200" && \
export VAULT_TOKEN=$$(vault write -field=token auth/approle/login role_id=$$VAULT_ROLEID) && \
export CONSUL_HTTP_TOKEN=$$(vault read -format=json consul_root/au/syd1/creds/terraform-vault | jq '.data.token')
endef
#init:
# @echo "Sourcing environment and initializing Terraform..."
# @source ./env && terraform init
#
#plan:
# @echo "Sourcing environment and planning Terraform changes..."
# @source ./env && terraform plan
#
#apply:
# @echo "Sourcing environment and applying Terraform changes..."
# @source ./env && terraform apply -auto-approve
init:
@$(call vault_env) && \
terragrunt run --all --non-interactive init -- -upgrade
@terragrunt run --all --non-interactive init -- -upgrade
plan: init
@$(call vault_env) && \
terragrunt run --all --parallelism 4 --non-interactive plan
@terragrunt run --all --parallelism 4 --non-interactive plan
apply: init
@$(call vault_env) && \
terragrunt run --all --parallelism 2 --non-interactive apply
@terragrunt run --all --parallelism 2 --non-interactive apply
format:
@echo "Formatting OpenTofu files..."