-
Notifications
You must be signed in to change notification settings - Fork 359
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
TFLint skips expressions that reference "each" #1139
Comments
The challenge in supporting The first approach is to change the interface of The second approach is to expand resources, similar to Terraform. The I think the latter is the better design, but needs a little more research. EDIT: We can solve the serialization issue by adding an |
Similar to #571, TFLint will not evaluate any attribute that references
each
:In theory, TFLint could attempt to evaluate the expression and determine whether its value is wholly "known" or not. If it is known, any expression containing
each
could be evaluated for all thefor_each
keys. This is a fair amount of effort to reproduce low level behavior of Terraform and should only be considered once #937 is released/stabilized.TFLint already does have some smarts around
for_each
and will skip evaluation entirely for resources wherecount
orfor_each
are either unevaluable or empty:https://github.com/terraform-linters/tflint/search?q=for_each
This prevents false positives for conditional resources. Avoiding false positives is more important (and usually easier) than maximizing expression coverage for complex (but state-less) expressions.
The text was updated successfully, but these errors were encountered: