Requirements
- terraform
- jq
# Dump terraform output to a file
terraform plan -out tfplan
# Show only the resource name and the action of those that will be updated or recreated
terraform show -json tfplan \
| jq -r '.resource_changes[] | select (.change.actions | inside(["create","update","delete"])) | [ .address, ( .change.actions | join(" ")) ] | @csv' \
| sed -e "s/delete\screate/replace/g" -e "s/create\sdelete/replace/g"