Terraform: `terraform validate` does not load `*.auto.tfvars` files.

Created on 9 Aug 2017  ยท  2Comments  ยท  Source: hashicorp/terraform

Terraform Version

Terraform v0.10.0

Terraform Configuration Files

main.tf

variable "test" {}

main.auto.tfvars

test = "test"

Actual Behavior

terraform validate returns * Required variable not set: test
terraform plan returns No changes. Infrastructure is up-to-date. as expected.

Expected Behavior

I expect that terraform validate would pick up on anything matching *.auto.tfvars.

References

The feature as described in the 0.10.0 changelog is Files in the config directory ending in .auto.tfvars are now loaded automatically..., which implies that the validate command should pick up on these. My guess is that the validate command was overlooked, but maybe this behavior is intentional?

The documentation does match the behavior, although validate isn't explicitly excluded.
https://www.terraform.io/intro/getting-started/variables.html
https://www.terraform.io/docs/commands/apply.html
https://www.terraform.io/docs/commands/validate.html

Most helpful comment

Hi @dmikalova,

Thanks for filing the issue.
I'm going to combine this with #15733, so we can take care of them with the same fix.

All 2 comments

Hi @dmikalova,

Thanks for filing the issue.
I'm going to combine this with #15733, so we can take care of them with the same fix.

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings