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:
Mitchell Hashimoto 2016-11-02 10:56:23 -07:00
parent 2be756642f
commit ec6e14c4d0
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
1 changed files with 10 additions and 4 deletions

View File

@ -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{},