From ba5c4ac5e36d3212629dc20e53c57a1a91882736 Mon Sep 17 00:00:00 2001 From: Daniel Schmidt Date: Fri, 23 Jan 2026 13:47:25 +0100 Subject: [PATCH] add comment about locals using shallow validation --- internal/terraform/node_local.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/terraform/node_local.go b/internal/terraform/node_local.go index c0edab0033..8e3376aad8 100644 --- a/internal/terraform/node_local.go +++ b/internal/terraform/node_local.go @@ -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)