Experimenting with more details for unknown for_each error
This was an attempt to try to report more context in an unknown for_each error by dragging unknown value origin information through the normal expression evaluation process using cty marks. However, it doesn't actually work because Terraform evaluates each expression separately in its own evaluation context, and so this trick of sneakily re-evaluating an expression with marks only when we hit an error can only ever find shallow references, which we can already find statically anyway. I'm just pushing this up to keep it for a possible second attempt later. I think a second attempt would need something more like the analyzer I built in #28944, but using marks and expression evaluation to deal with its analyses instead of the custom static technique I tried there.
Showing
+227 -5
... | ... | @@ -114,7 +114,7 @@ require ( |
github.com/xanzy/ssh-agent v0.2.1 | ||
github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18 // indirect | ||
github.com/xlab/treeprint v0.0.0-20161029104018-1d6e34225557 | ||
github.com/zclconf/go-cty v1.8.4 | ||
github.com/zclconf/go-cty v1.8.5-0.20210621160911-b9c7d6be66e1 | ||
github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b | ||
github.com/zclconf/go-cty-yaml v1.0.2 | ||
go.uber.org/atomic v1.3.2 // indirect | ||
... | ... |
internal/lang/marks/resource_derived.go
0 → 100644
Please register or sign in to comment