-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Terraform apply should show summaries even on failures #38343
Copy link
Copy link
Open
Labels
Description
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/installUse 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
Reactions are currently unavailable