-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Goal
Add filters for terraform plan and terraform apply — two of the highest line-count outputs in the DevOps toolchain.
Background
A terraform plan with 100 managed resources where a single attribute changes generates ~140 lines per resource showing every attribute, whether changed or not. Real-world reports: plans for 1,000-resource infrastructures produce 10,000+ line outputs. Community tools like terraform-plan-filter and tf-summarize exist specifically for this pain point, showing strong demand. The same output is repeated verbatim during terraform apply.
Hashicorp issue #21639 tracks this, open since 2019.
Filters to Add
terraform/plan.toml — terraform plan
- Skip: resource attribute lines showing unchanged values (lines with
=but no+,-,~, or->change marker), comment lines noting "# (known after apply)" for unchanged resources - Keep:
- Lines with
+(resource creation) - Lines with
-(resource deletion) - Lines with
~(resource modification) - Lines with
->(in-place update of attribute value) # <resource> will be created/destroyed/updatedheader linesPlan: X to add, Y to change, Z to destroy.summaryNo changes.output- Error lines
- Lines with
terraform/apply.toml — terraform apply
- Similar to
plan.tomlfor the plan portion - Keep all: progress lines during apply (
<resource>: Creating...,<resource>: Creation complete after Xs) - Keep:
Apply complete! Resources: X added, Y changed, Z destroyed. - Skip: the verbose attribute echo during apply for unchanged attributes
tofu/plan.toml + tofu/apply.toml
- OpenTofu fork uses identical output format — add as separate filter files resolving to the same logic (or symlink-equivalent TOML)
Fixture Files Needed
tests/fixtures/terraform/plan-changes.txt— plan with a few changed resources in a large statetests/fixtures/terraform/plan-no-changes.txt— no-op plan outputtests/fixtures/terraform/apply-success.txt— successful apply with creation outputtests/fixtures/terraform/apply-error.txt— apply failure
Acceptance Criteria
- Unchanged resource attribute lines removed from plan output
- All
+,-,~change lines preserved - Plan summary line always preserved
-
terraform applycreation progress lines preserved -
tofuresolves to same filters asterraform - Integration tests pass for all fixture files
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request