core: Fix evaluation of collections of resource instances

This commit is contained in:
Martin Atkins 2018-08-27 18:04:22 -07:00
parent 97da905c6e
commit 6acf335e60
1 changed files with 2 additions and 2 deletions

View File

@ -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,