Replies: 9 comments 8 replies
-
Duplicate of #1877 tflint --var 'foo=bar'
|
Beta Was this translation helpful? Give feedback.
-
@bendrucker I'm sorry, but I'm not sure I understand how this is a solution for me. As a user I want to use |
Beta Was this translation helpful? Give feedback.
-
Reading the tickets you mentioned, they seem to describe a very different issue than the new feature I'm proposing. |
Beta Was this translation helpful? Give feedback.
-
Hmm, I looked at echo 'foo = "bar"' > terraform.tfvars
tflint --var-file terraform.tfvars
# nothing... #1941 says:
Given that the goal is to error in the cases where Terraform prints a warning, this is looking more like a bug/inconsistency. |
Beta Was this translation helpful? Give feedback.
-
Reading the above comment, it seems like Terraform intentionally makes this a warning rather than an error. There is room for discussion on whether TFLint should actively raise an error or conservatively keep the same behavior as Terraform. Personally, I think it might be better to provide it as a rule that can be enabled when needed. |
Beta Was this translation helpful? Give feedback.
-
If |
Beta Was this translation helpful? Give feedback.
-
It's consistent, but I'm not sure if it helps. Unlike Terraform warnings, TFLint logs are intended for debugging, so they may not be useful for finding typos or other problems. In your use case, does this help? |
Beta Was this translation helpful? Give feedback.
-
Hmm ok, definitely not a bug on a third pass... terraform plan -var foo=bar
terraform plan -var-file <(echo foo=bar)
TFLint is consistent with Terraform. As far as a rule, the struggle will be referencing the tfvars files. Because they are not part of the module, you'd have to enumerate every tfvars file in the rule config. And then your config is only valid a specific module. |
Beta Was this translation helpful? Give feedback.
-
Just upgraded my Terragrunt version which includes a newer TFLint version and this is a breaking behaviour. We inject a lot of automatic variables that not all modules have, especially third party ones. This really should be a rule that can be toggled. |
Beta Was this translation helpful? Give feedback.
-
Introduction
Terraform gives appropriate warnings for values found in tfvars without a corresponding variable in the configuration:
Proposal
tflint should also raise errors for the same problem.
References
N/A
Beta Was this translation helpful? Give feedback.
All reactions