Interview Prep/Terraform/Rapid-Fire Commands

List resources the plan will destroy with jq?

IntermediateProductionRapid-Fire Commands
Answer
terraform show -json tfplan | jq -r '.resource_changes[] | select(.change.actions|index("delete")) | .address'

Handy as a CI gate.

All Terraform questions

More on Rapid-Fire Commands