From 9e8ddaed47b1994d388a2e516a4427a3165d84d6 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Thu, 16 Mar 2017 13:41:55 -0400 Subject: [PATCH] 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. --- terraform/interpolate.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/terraform/interpolate.go b/terraform/interpolate.go index 993317e9e..7a3270fc9 100644 --- a/terraform/interpolate.go +++ b/terraform/interpolate.go @@ -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)