From 7dc3c51a86f54e62898ea23ebbd09177f58ac6ee Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Fri, 25 May 2018 19:36:19 -0700 Subject: [PATCH] core: Only create stub provider if real provider is not present Previously we'd create the stub provider in any case where we didn't need a configured provider, but we also need to skip creating it if there's already a provider node present, or else we can end up with multiple stub nodes in the graph. --- terraform/transform_provider.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/transform_provider.go b/terraform/transform_provider.go index 4b2c91c5f8..4641207775 100644 --- a/terraform/transform_provider.go +++ b/terraform/transform_provider.go @@ -210,7 +210,7 @@ func (t *ProviderTransformer) Transform(g *Graph) error { // If this provider doesn't need to be configured then we can just // stub it out with an init-only provider node, which will just // start up the provider and fetch its schema. - if _, exists := needConfigured[key]; !exists { + if _, exists := needConfigured[key]; target == nil && !exists { stubAddr := p.ProviderConfig.Absolute(addrs.RootModuleInstance) stub := &NodeEvalableProvider{ &NodeAbstractProvider{