terraform: convert import graph to use new provider nodes
This uses the new NodeApplyableProvider graph nodes. This will just make it easier for us in the future to adopt new graph transforms by starting to use the new ones here.
This commit is contained in:
parent
2be756642f
commit
ec6e14c4d0
|
@ -36,6 +36,14 @@ func (b *ImportGraphBuilder) Steps() []GraphTransformer {
|
|||
mod = module.NewEmptyTree()
|
||||
}
|
||||
|
||||
// Custom factory for creating providers.
|
||||
providerFactory := func(name string, path []string) GraphNodeProvider {
|
||||
return &NodeApplyableProvider{
|
||||
NameValue: name,
|
||||
PathValue: path,
|
||||
}
|
||||
}
|
||||
|
||||
steps := []GraphTransformer{
|
||||
// Create all our resources from the configuration and state
|
||||
&ConfigTransformerOld{Module: mod},
|
||||
|
@ -44,13 +52,11 @@ func (b *ImportGraphBuilder) Steps() []GraphTransformer {
|
|||
&ImportStateTransformer{Targets: b.ImportTargets},
|
||||
|
||||
// Provider-related transformations
|
||||
&MissingProviderTransformer{Providers: b.Providers},
|
||||
&MissingProviderTransformer{Providers: b.Providers, Factory: providerFactory},
|
||||
&ProviderTransformer{},
|
||||
&DisableProviderTransformerOld{},
|
||||
&PruneProviderTransformer{},
|
||||
|
||||
// Insert nodes to close opened plugin connections
|
||||
&CloseProviderTransformer{},
|
||||
&AttachProviderConfigTransformer{Module: mod},
|
||||
|
||||
// Single root
|
||||
&RootTransformer{},
|
||||
|
|
Loading…
Reference in New Issue