2020-04-05 13:02:58 -07:00
|
|
|
# terraform fmt
|
|
|
|
|
|
|
|
> Format configuration according to Terraform language style conventions.
|
2024-11-03 20:04:38 -08:00
|
|
|
> More information: <https://developer.hashicorp.com/terraform/cli/commands/fmt>.
|
2020-04-05 13:02:58 -07:00
|
|
|
|
|
|
|
- Format the configuration in the current directory:
|
|
|
|
|
|
|
|
`terraform fmt`
|
|
|
|
|
|
|
|
- Format the configuration in the current directory and subdirectories:
|
|
|
|
|
|
|
|
`terraform fmt -recursive`
|
|
|
|
|
|
|
|
- Display diffs of formatting changes:
|
|
|
|
|
|
|
|
`terraform fmt -diff`
|
|
|
|
|
2022-12-04 08:53:34 +01:00
|
|
|
- Do not list files that were formatted to `stdout`:
|
2020-04-05 13:02:58 -07:00
|
|
|
|
|
|
|
`terraform fmt -list=false`
|