Difference between revisions of "Terraform fmt"
Jump to navigation
Jump to search
Line 33: | Line 33: | ||
== See also == | == See also == | ||
* {{fmt}} | * {{fmt}} | ||
+ | * {{terraform fmt}} | ||
* {{terraform cmd}} | * {{terraform cmd}} | ||
− | |||
[[Category:Terraform]] | [[Category:Terraform]] |
Revision as of 15:16, 6 February 2023
terraform fmt
command is used to rewrite Terraform configuration files to a canonical format and style.
terraform fmt -diff terraform fmt -check terraform fmt -write -recursive
Examples
terraform fmt (no output)
terraform fmt main.tf
terraform fmt main.tf variables.tf
- (no output)
-diff
- Display diffs of formatting changes
Related commands
go fmt
and import "fmt"cfn-lint
- Linter
terraform validate
terraform apply
- Terraform Style Conventions
See also
- fmt:
go fmt, terraform fmt, terragrunt hclfmt
terraform fmt [ -diff | -check | validate | --help ]
terraform
[untaint | fmt
|apply
|show
|state
|init | plan | console | output
|validate
|destroy
|debug
|import
|providers
|get
|graph
|workspaces
|resource
|login
|-var-file
|state mv
|state pull
|state push
|state replace-provider
|state rm
|force-unlock
|env
|tfe
|--version
|remote-exec
|delete on termination
| deprecated commands |terraform --help
]
Advertising: