From 6acf335e604425c54fada4a4d31c459ae430c6dd Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Mon, 27 Aug 2018 18:04:22 -0700 Subject: [PATCH] core: Fix evaluation of collections of resource instances --- terraform/evaluate.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform/evaluate.go b/terraform/evaluate.go index 20dfbdfb2..f1d3b016c 100644 --- a/terraform/evaluate.go +++ b/terraform/evaluate.go @@ -483,7 +483,7 @@ func (d *evaluationStateData) GetResourceInstance(addr addrs.ResourceInstance, r return cty.DynamicVal, diags } case states.EachList: - multi = key != addrs.NoKey + multi = key == addrs.NoKey if _, ok := addr.Key.(addrs.IntKey); !multi && !ok { diags = diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, @@ -494,7 +494,7 @@ func (d *evaluationStateData) GetResourceInstance(addr addrs.ResourceInstance, r return cty.DynamicVal, diags } case states.EachMap: - multi = key != addrs.NoKey + multi = key == addrs.NoKey if _, ok := addr.Key.(addrs.IntKey); !multi && !ok { diags = diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError,