-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
file.tfvars not being read #17163
Comments
Hi @AnthonyWC, Can you explain which issue exactly you're referring to? The original cases in each of those linked issues are confirmed to work, but there are a number of confusing comments from users on both. Since those specific cases are closed, we can use this issue to work on another use case. |
Filenames with .tfvars in the same directory are not automatically being read when executing command such as terraform plan, you need to explicitly specific "-var-file=example1.tfvars". aws.tf
backend.tf
vars-account.tf
vars.tfvars
Result:
|
Hi @AnthonyWC, That is the expected behavior, since many configurations rely on specifying different variable files from in the CLI flags. In the Variable Files documentation, the file names that are automatically loaded are |
Thanks, I thought it was supposed to load all .tfvars file in the directory. I am probably not the only one who was expecting that due to the way how it handles .tf file. :) |
In documentation it says : "For all files which match terraform.tfvars or *.auto.tfvars present in the current directory, Terraform automatically loads them to populate variables." Not all *.tfvars files. |
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. |
Terraform Version
This is not a new issue but to draw attention that an existing issue has not been fixed (or have re-surfaced). Work-around with -var-file to specifiy .tfvars file works (with terraform plan/validate). Please close this ticket and re-open one of this existing ticket(s):
Ref.
#2659
#15894
The text was updated successfully, but these errors were encountered: