Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/v1.14/BUGFIX-20250927-184134.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind: BUGFIX
body: The CLI now summarizes the number of actions invoked during `terraform apply`, matching the plan output.
time: 2025-09-27T18:41:34.771437+02:00
custom:
Issue: "37689"
23 changes: 11 additions & 12 deletions internal/command/views/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,26 @@ type ApplyHuman struct {
var _ Apply = (*ApplyHuman)(nil)

func (v *ApplyHuman) ResourceCount(stateOutPath string) {
var summary string
if v.destroy {
v.view.streams.Printf(
v.view.colorize.Color("[reset][bold][green]\nDestroy complete! Resources: %d destroyed.\n"),
v.countHook.Removed,
)
summary = fmt.Sprintf("Destroy complete! Resources: %d destroyed.", v.countHook.Removed)
} else if v.countHook.Imported > 0 {
v.view.streams.Printf(
v.view.colorize.Color("[reset][bold][green]\nApply complete! Resources: %d imported, %d added, %d changed, %d destroyed.\n"),
summary = fmt.Sprintf("Apply complete! Resources: %d imported, %d added, %d changed, %d destroyed.",
v.countHook.Imported,
v.countHook.Added,
v.countHook.Changed,
v.countHook.Removed,
)
v.countHook.Removed)
} else {
v.view.streams.Printf(
v.view.colorize.Color("[reset][bold][green]\nApply complete! Resources: %d added, %d changed, %d destroyed.\n"),
summary = fmt.Sprintf("Apply complete! Resources: %d added, %d changed, %d destroyed.",
v.countHook.Added,
v.countHook.Changed,
v.countHook.Removed,
)
v.countHook.Removed)
}
v.view.streams.Print(v.view.colorize.Color("[reset][bold][green]\n" + summary))
if v.countHook.ActionInvocation > 0 {
v.view.streams.Print(v.view.colorize.Color(fmt.Sprintf("[reset][bold][green] Actions: %d invoked.", v.countHook.ActionInvocation)))
}
v.view.streams.Print("\n")
if (v.countHook.Added > 0 || v.countHook.Changed > 0) && stateOutPath != "" {
v.view.streams.Printf("\n%s\n\n", format.WordWrap(stateOutPathPostApply, v.view.outputColumns()))
v.view.streams.Printf("State path: %s\n", stateOutPath)
Expand Down