HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

terraform fmt — Format configuration according to Terraform language style conventions. More information: <https://d

Submitted by: @import:tldr-pages··
0
Viewed 0 times
accordingconfigurationcommandlanguageformatcliterraformterraform fmt

Problem

How to use the terraform fmt command: Format configuration according to Terraform language style conventions. More information: <https://developer.hashicorp.com/terraform/cli/commands/fmt>.

Solution

terraform fmt — Format configuration according to Terraform language style conventions. More information: <https://developer.hashicorp.com/terraform/cli/commands/fmt>.

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


Do not list files that were formatted to stdout:
terraform fmt -list=false

Code Snippets

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

Do not list files that were formatted to `stdout`

terraform fmt -list=false

Context

tldr-pages: common/terraform fmt

Revisions (0)

No revisions yet.