Skip to content

Commit 6668583

Browse files
committed
Only check that the import stub is non-null when importing by ID
1 parent c9f707b commit 6668583

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/terraform/node_resource_plan_instance.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ func (n *NodePlannableResourceInstance) importState(ctx EvalContext, addr addrs.
778778
}
779779

780780
importedState := states.NewResourceInstanceObjectFromIR(imported[0])
781-
if deferred == nil && importedState.Value.IsNull() {
781+
if deferred == nil && importType == "ID" && importedState.Value.IsNull() {
782782
// It's actually okay for a deferred import to have returned a null.
783783
diags = diags.Append(tfdiags.Sourceless(
784784
tfdiags.Error,

0 commit comments

Comments
 (0)