mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-25 01:00:16 -05:00
Plannable import 3: Make import plannable (#33085)
During a plan, Terraform now checks for the presence of import blocks. For each resource in config, if an import block is present with a matching address, planning that node will now trigger an ImportResourceState and ReadResource. The resulting state is treated as the node's "refresh state", and planning proceeds as normal from there. The walkImport operation is now only used for the legacy "terraform import" CLI command. This is the only case under which the plan should produce graphNodeImportStates.
This commit is contained in:
@@ -230,8 +230,9 @@ func (cs *ChangeSrc) Decode(ty cty.Type) (*Change, error) {
|
||||
}
|
||||
|
||||
return &Change{
|
||||
Action: cs.Action,
|
||||
Before: before.MarkWithPaths(cs.BeforeValMarks),
|
||||
After: after.MarkWithPaths(cs.AfterValMarks),
|
||||
Action: cs.Action,
|
||||
Before: before.MarkWithPaths(cs.BeforeValMarks),
|
||||
After: after.MarkWithPaths(cs.AfterValMarks),
|
||||
Importing: cs.Importing,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user