Difference between revisions of "Terraform fmt"
Jump to navigation
Jump to search
Line 28: | Line 28: | ||
* <code>[[terraform apply]]</code> | * <code>[[terraform apply]]</code> | ||
* [[Terraform Style Conventions]] | * [[Terraform Style Conventions]] | ||
− | * [[terragrunt fmt]] | + | * <code>[[terragrunt fmt]]</code> |
* <code>[[Warning: Interpolation-only expressions are deprecated]]</code> | * <code>[[Warning: Interpolation-only expressions are deprecated]]</code> | ||
* <code>[[.pre-commit-config.yaml]]</code> | * <code>[[.pre-commit-config.yaml]]</code> |
Revision as of 18:27, 28 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
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: