From 37e8147c4ff0efbd73c4d07398cdc209b9c93e1a Mon Sep 17 00:00:00 2001 From: Pam Selle <204372+pselle@users.noreply.github.com> Date: Wed, 28 Aug 2019 15:13:36 -0400 Subject: [PATCH] Spiffy comment --- terraform/eval_for_each.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/terraform/eval_for_each.go b/terraform/eval_for_each.go index 1db1c3fad..f03e02c27 100644 --- a/terraform/eval_for_each.go +++ b/terraform/eval_for_each.go @@ -75,7 +75,10 @@ func evaluateResourceForEachExpressionKnown(expr hcl.Expression, ctx EvalContext return nil, true, diags } - // For sets, we need to recursively check ...and add reasoning why this works here + // A set may contain unknown values that must be + // discovered by checking with IsWhollyKnown (which iterates through the + // structure), while for maps in cty, keys can never be unknown or null, + // thus the earlier IsKnown check suffices for maps if !forEachVal.IsWhollyKnown() { return map[string]cty.Value{}, false, diags }