Skip to content

Commit

Permalink
feat: only act on resources that are created xor destroyed but not on…
Browse files Browse the repository at this point in the history
… resources that are replaced (busser#84)
  • Loading branch information
untcha committed Feb 29, 2024
1 parent d3364e3 commit a73f15d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/engine/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ func SummarizeJSONPlan(moduleID string, jsonPlan *tfjson.Plan) (Plan, error) {
isCreated := slices.Contains(rc.Change.Actions, tfjson.ActionCreate)
isDestroyed := slices.Contains(rc.Change.Actions, tfjson.ActionDelete)

if !isCreated && !isDestroyed {
// Only act on resources that are created XOR destroyed but not on resources that are replaced
isReplaced := isCreated && isDestroyed

if (!isCreated && !isDestroyed) || isReplaced {
continue
}

Expand Down

0 comments on commit a73f15d

Please sign in to comment.