actions: add missing actions output for terraform apply cli (#37692)

pull/37558/head
Akella Umesh 5 months ago committed by GitHub
parent 04c95feb8d
commit ea20db63fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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"

@ -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)

Loading…
Cancel
Save