From 2a8aa6a13929ab9d0b0ac748a0e0b200314275c5 Mon Sep 17 00:00:00 2001 From: Kristin Laemmert Date: Fri, 28 Sep 2018 10:32:34 -0700 Subject: [PATCH] plans/objchange: if priorV is unknown, fall through to the recursive call to `ProposedNewObject` --- plans/objchange/objchange.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plans/objchange/objchange.go b/plans/objchange/objchange.go index 5870dbf33..e328f6e02 100644 --- a/plans/objchange/objchange.go +++ b/plans/objchange/objchange.go @@ -96,7 +96,7 @@ func ProposedNewObject(schema *configschema.Block, prior, config cty.Value) cty. newVals := make([]cty.Value, 0, l) for it := configV.ElementIterator(); it.Next(); { idx, configEV := it.Element() - if !priorV.HasIndex(idx).True() { + if priorV.IsKnown() && !priorV.HasIndex(idx).True() { // If there is no corresponding prior element then // we just take the config value as-is. newVals = append(newVals, configEV) @@ -159,7 +159,7 @@ func ProposedNewObject(schema *configschema.Block, prior, config cty.Value) cty. for it := configV.ElementIterator(); it.Next(); { idx, configEV := it.Element() k := idx.AsString() - if !priorV.HasIndex(idx).True() { + if priorV.IsKnown() && !priorV.HasIndex(idx).True() { // If there is no corresponding prior element then // we just take the config value as-is. newVals[k] = configEV