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.
This commit is contained in:
parent
f82c192c49
commit
b73e4ede5d
|
@ -342,7 +342,7 @@ func (n *NodeAbstractResourceInstance) ProvidedBy() (addrs.AbsProviderConfig, bo
|
||||||
|
|
||||||
Guess:
|
Guess:
|
||||||
// Use our type and containing module path to guess a provider configuration address
|
// 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
|
// GraphNodeProvisionerConsumer
|
||||||
|
|
Loading…
Reference in New Issue