Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko committed Jan 15, 2025
1 parent c502045 commit 4089571
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions internal/terraform/node_resource_abstract_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -2843,12 +2843,7 @@ func getAction(addr addrs.AbsResourceInstance, priorVal, plannedNewVal cty.Value
switch {
case priorVal.IsNull():
action = plans.Create
case !writeOnly.Intersection(reqRep).Empty():
action = plans.DeleteThenCreate
actionReason = plans.ResourceInstanceReplaceBecauseCannotUpdate
case eq && !matchedForceReplace:
action = plans.NoOp
case matchedForceReplace || !reqRep.Empty():
case matchedForceReplace || !reqRep.Empty() || !writeOnly.Intersection(reqRep).Empty():
// If the user "forced replace" of this instance of if there are any
// "requires replace" paths left _after our filtering above_ then this
// is a replace action.
Expand All @@ -2863,6 +2858,8 @@ func getAction(addr addrs.AbsResourceInstance, priorVal, plannedNewVal cty.Value
case !reqRep.Empty():
actionReason = plans.ResourceInstanceReplaceBecauseCannotUpdate
}
case eq && !matchedForceReplace:
action = plans.NoOp
default:
action = plans.Update
// "Delete" is never chosen here, because deletion plans are always
Expand Down

0 comments on commit 4089571

Please sign in to comment.