Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #207, supplying AWS_DEFAULT_REGION fixes v0.12 tf validate #208

Closed
5 changes: 4 additions & 1 deletion modules/terraform/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ terraform/get-modules:
@$(TERRAFORM) init -get -backend=false -input=false >/dev/null

## Basic terraform sanity check
## For v0.12.x, we supply a random region to AWS_DEFAULT_REGION so as to fix the
## "The argument "region" is required" error when validating independent modules.
## More info: https://github.com/hashicorp/terraform/issues/21408#issuecomment-495746582
terraform/validate:
Gowiem marked this conversation as resolved.
Show resolved Hide resolved
ifeq ("12","$(word 2, $(subst ., ,$(TERRAFORM_VERSION)))")
@echo "Terraform 0.12 does not support validate without skipping variables"
@AWS_DEFAULT_REGION="us-west-2" $(TERRAFORM) validate
Gowiem marked this conversation as resolved.
Show resolved Hide resolved
else
@$(TERRAFORM) validate -check-variables=false
endif
Expand Down