Difference between revisions of "Terraform fmt"
Jump to navigation
Jump to search
↑ https://www.terraform.io/docs/cli/commands/fmt.html
Line 3: | Line 3: | ||
[[terraform fmt --help]] | [[terraform fmt --help]] | ||
− | [[terraform fmt -diff]] | + | [[terraform fmt -diff]] Display diffs of formatting changes |
[[terraform fmt -check]] | [[terraform fmt -check]] | ||
[[terraform fmt -recursive]] | [[terraform fmt -recursive]] | ||
Line 22: | Line 22: | ||
[[terraform fmt -check]] | [[terraform fmt -check]] | ||
(no output) | (no output) | ||
− | |||
− | |||
== Related commands == | == Related commands == |
Revision as of 17:25, 15 November 2023
terraform fmt
command is used to rewrite Terraform configuration files to a canonical format and style. [1]
terraform fmt --help terraform fmt -diff Display diffs of formatting changes 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)
Related commands
cfn-lint
terraform validate
terraform apply
- Terraform Style Conventions
terragrunt fmt
Warning: Interpolation-only expressions are deprecated
.pre-commit-config.yaml
See also
terraform fmt [ -diff | -check | validate | --help ]
- fmt:
go fmt, terraform fmt, terragrunt hclfmt
- Linter,
cfn-lint
,ansible-lint
,terraform fmt
,go fmt
,solhint
Advertising: