Don't interpolate multivariables during walkInput

We don't need these expanded for input, and if the multivar's count is a
variable, it may be known but not available during the input walk.
This commit is contained in:
James Bardin 2017-03-16 13:41:55 -04:00
parent fe5f519817
commit 9e8ddaed47

View File

@ -540,6 +540,13 @@ func (i *Interpolater) computeResourceMultiVariable(
unknownVariable := unknownVariable()
// If we're only looking for input, we don't need to expand a
// multi-variable. This prevents us from encountering things that should be
// known but aren't because the state has yet to be refreshed.
if i.Operation == walkInput {
return &unknownVariable, nil
}
// Get the information about this resource variable, and verify
// that it exists and such.
module, cr, err := i.resourceVariableInfo(scope, v)