From b73e4ede5dc23268a0164d47742edd30e3948b51 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Wed, 9 May 2018 16:29:10 -0700 Subject: [PATCH] core: use correct fallback provider address for abstract resource instance Previously we were attempting to construct a default manually here, and actually getting it wrong by using the resource type name as a whole rather than the expected inferrence by prefix. Now we use the method provided in the addrs package for this purpose, which implements the standard behavior of shaving off the first underscore-separated word from the resource type name. --- terraform/node_resource_abstract.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/node_resource_abstract.go b/terraform/node_resource_abstract.go index ae3cb3fe5..2f3592bcc 100644 --- a/terraform/node_resource_abstract.go +++ b/terraform/node_resource_abstract.go @@ -342,7 +342,7 @@ func (n *NodeAbstractResourceInstance) ProvidedBy() (addrs.AbsProviderConfig, bo Guess: // Use our type and containing module path to guess a provider configuration address - return addrs.NewDefaultProviderConfig(n.Addr.Resource.Type).Absolute(n.Addr.Module), false + return n.Addr.Resource.DefaultProviderConfig().Absolute(n.Path()), false } // GraphNodeProvisionerConsumer