add comment about locals using shallow validation

pull/38064/head^2
Daniel Schmidt 4 weeks ago
parent 84eeb0a113
commit ba5c4ac5e3

@ -140,6 +140,10 @@ func (n *NodeLocal) References() []*addrs.Reference {
func (n *NodeLocal) Execute(ctx EvalContext, op walkOperation) (diags tfdiags.Diagnostics) {
namedVals := ctx.NamedValues()
val, diags := evaluateLocalValue(n.Config, n.Addr.LocalValue, n.Addr.String(), ctx)
// We only use a shallow evaluation of deprecations here because we only want to warn
// if the entire value is deprecated. If e.g. a module is stored in the local and the module
// contains a deprecated output we don't want to warn about that here, but only when the
// output is actually referenced.
valWithoutDeprecations, deprecationDiags := ctx.Deprecations().Validate(val, n.ModulePath(), n.Config.Expr.Range().Ptr())
diags = diags.Append(deprecationDiags)

Loading…
Cancel
Save