opentofu/terraform/transform_attach_config_provider.go
Martin Atkins d4285dd27f core: Attach resource and provider config schemas during graph build
This is a little awkward since we need to instantiate the providers much
earlier than before. To avoid a lot of reshuffling here we just spin each
one up and then immediately shut it down again, letting our existing init
functionality during the graph walk still do the main initialization.
2018-10-16 18:46:46 -07:00

20 lines
526 B
Go

package terraform
import (
"github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/configs"
)
// GraphNodeAttachProvider is an interface that must be implemented by nodes
// that want provider configurations attached.
type GraphNodeAttachProvider interface {
// Must be implemented to determine the path for the configuration
GraphNodeSubPath
// ProviderName with no module prefix. Example: "aws".
ProviderAddr() addrs.AbsProviderConfig
// Sets the configuration
AttachProvider(*configs.Provider)
}