Skip to content

Commit 49e8b56

Browse files
authored
Only check that the import stub is non-null when importing by ID (#36990)
1 parent c3b5b84 commit 49e8b56

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 && !importTarget.Type().IsObjectType() && 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)