Skip to content

Commit e4be158

Browse files
mildwonkeykmoe
authored andcommitted
command/import: fix error during import when implied provider was not used (#22855)
* command/import: properly use `-provider` supplied on the command line The import command now attaches the provider configuration in the resource instance, if set. That config is attached to the NodeAbstractResource during the import graph building. This prevents errors when the implied provider is not actually in the configuration at all, which may happen when a configuration is using the `-beta` version of a provider (and only that `-beta` version). * command/import: fix variable reassignment and update docs Fixes #22564
1 parent e664f5b commit e4be158

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

terraform/graph_builder_import.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ func (b *ImportGraphBuilder) Steps() []GraphTransformer {
5555
// Create all our resources from the configuration and state
5656
&ConfigTransformer{Config: config},
5757

58+
// Attach the configuration to any resources
59+
&AttachResourceConfigTransformer{Config: b.Config},
60+
5861
// Add the import steps
5962
&ImportStateTransformer{Targets: b.ImportTargets},
6063

0 commit comments

Comments
 (0)