terraform fmt
terraform fmt
command is used to rewrite Terraform configuration files to a canonical format and style. [1]
terraform fmt --help terraform fmt -diff terraform fmt -check terraform fmt -recursive terraform fmt -write -recursive terraform fmt -check -recursive -diff
Examples
terraform fmt (no output)
terraform fmt main.tf
terraform fmt main.tf variables.tf
terraform fmt -check (no output)
-diff
- Display diffs of formatting changes
Related commands
See also
Advertising: