Skip to content

Terraform apply should show summaries even on failures #38343

@purajit

Description

@purajit

Terraform Version

Terraform v1.14.7
on darwin_arm64
+ provider registry.terraform.io/hashicorp/local v2.8.0
+ provider registry.terraform.io/hashicorp/null v3.2.4

Your version of Terraform is out of date! The latest version
is 1.14.8. You can update by downloading from https://developer.hashicorp.com/terraform/install

Use Cases

Knowing what changed before an apply failed is still critically important - whether you're viewing results stream in or extracting summaries programmatically.

Attempted Solutions

Using text-based extraction and creating my own summary using terraform apply -json results with jq. However, this is rather non-ideal since it relies on specific schemas and outputs, and doesn't show up as native terraform output in workflows.

I have a PR for it that works at #38344!

Proposal

Just emit the summary line before failing!

In human-readable mode, this would look like

Apply incomplete with errors! Resources: 1 added, 0 changed, 0 destroyed.

In JSON mode, it would look the same as it does right now for a successful run. We could add an additional flag for incompleteness if needed.

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions