Skip to content

Commit 1afde6d

Browse files
add comment about locals using shallow validation
1 parent d56bd20 commit 1afde6d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/terraform/node_local.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ func (n *NodeLocal) References() []*addrs.Reference {
140140
func (n *NodeLocal) Execute(ctx EvalContext, op walkOperation) (diags tfdiags.Diagnostics) {
141141
namedVals := ctx.NamedValues()
142142
val, diags := evaluateLocalValue(n.Config, n.Addr.LocalValue, n.Addr.String(), ctx)
143+
// We only use a shallow evaluation of deprecations here because we only want to warn
144+
// if the entire value is deprecated. If e.g. a module is stored in the local and the module
145+
// contains a deprecated output we don't want to warn about that here, but only when the
146+
// output is actually referenced.
143147
valWithoutDeprecations, deprecationDiags := ctx.Deprecations().Validate(val, n.ModulePath(), n.Config.Expr.Range().Ptr())
144148
diags = diags.Append(deprecationDiags)
145149

0 commit comments

Comments
 (0)