[terraform evaluator] Failed to expand block. Invalid "for-each" argument. #7888
Replies: 3 comments 3 replies
-
Hi @robbert-nlo ! Trivy performs static scanning and does not know anything about the attributes of data blocks. You can find the answer regarding data blocks here. |
Beta Was this translation helpful? Give feedback.
-
I was about to start my own discussion @nikpivkin but it appears there are a number of similar issues and this one seems the closest. Here is a (relatively) simple example in my case
As others have reported, for this module I receive the following error
I would expect Trivy to successfully scan this module out of the box or at minimum, allow someone to provide values, or at absolute minimum not error out. |
Beta Was this translation helpful? Give feedback.
-
It's been fixed via #7964 - will be out in the next release. |
Beta Was this translation helpful? Give feedback.
-
Description
Terraform evaluator shows language errors for valid configuration:
ERROR [terraform evaluator] Failed to expand block. Invalid "for-each" argument. Must be known and iterable. block="data.azurerm_subnet.spoke" value="cty.NilVal"
Desired Behavior
No errors are shown for valid configuration.
Actual Behavior
An error is shown.
Reproduction Steps
Target
Filesystem
Scanner
Misconfiguration
Output Format
Table
Mode
Standalone
Debug Output
Operating System
macOS Sonoma
Version
Checklist
trivy clean --all
Beta Was this translation helpful? Give feedback.
All reactions