mirror of https://github.com/hashicorp/terraform
In #14526 we fixed a sticky edge-case where a resource with count = 0 set won't create its containing module state on apply, and thus when another expression refers to it we need to deal with that absense. The original bug fixed by #14526 was actually a nil dereference panic in this case. Our new HCL2-oriented expression evaluation codepath was, on the other hand, correctly checking for the nil, but was not taking the correct action in response to it, leading to the result being an unexpected unknown value. Here we replicate the fix to #14526 by behaving as if there are just no instances present in this case. We achieve this in a slightly different way here by just creating an empty ModuleState, but the effect is the same as #14526. This fixes TestContext2Apply_multiVarMissingState.pull/19086/head
parent
26f76dd222
commit
da2d91c0e4
Loading…
Reference in new issue