tfsort

CLI tool to sort Terraform variables and outputs alphabetically

brewmacoslinux
Try with needOr install directly
Source

About

CLI to sort Terraform variables and outputs

Commands

tfsort

Examples

Sort variables in a Terraform file and write to stdout$ tfsort variables.tf
Sort and overwrite the original file in place$ tfsort -w variables.tf
Sort multiple Terraform files in a directory$ tfsort -w *.tf