core: Fix evaluation of collections of resource instances
This commit is contained in:
parent
97da905c6e
commit
6acf335e60
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue