Editing Terraform fmt
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
{{lowercase}} | {{lowercase}} | ||
− | <code>terraform fmt</code> command is used to rewrite Terraform configuration files to a canonical format and style. | + | <code>terraform fmt</code> command is used to rewrite Terraform configuration files to a canonical format and style. |
+ | * https://www.terraform.io/docs/cli/commands/fmt.html | ||
− | + | [[terraform fmt -diff]] | |
− | [[terraform fmt -diff]] | ||
[[terraform fmt -check]] | [[terraform fmt -check]] | ||
− | |||
[[terraform fmt -write -recursive]] | [[terraform fmt -write -recursive]] | ||
− | |||
== Examples == | == Examples == | ||
+ | [[terraform]] fmt | ||
+ | (no output) | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
terraform fmt | terraform fmt | ||
[[main.tf]] | [[main.tf]] | ||
Line 24: | Line 18: | ||
[[variables.tf]] | [[variables.tf]] | ||
− | + | * <code>[[terraform fmt -check]]</code> | |
− | + | :(no output) | |
− | |||
− | |||
− | : | ||
− | + | * <code>[[-diff]]</code> - Display diffs of formatting changes | |
− | * | ||
== Related commands == | == Related commands == | ||
+ | * <code>[[go fmt]]</code> and [[import "fmt"]] | ||
* <code>[[cfn-lint]]</code> | * <code>[[cfn-lint]]</code> | ||
+ | * [[Linter]] | ||
* <code>[[terraform validate]]</code> | * <code>[[terraform validate]]</code> | ||
* <code>[[terraform apply]]</code> | * <code>[[terraform apply]]</code> | ||
* [[Terraform Style Conventions]] | * [[Terraform Style Conventions]] | ||
− | * | + | * [[terragrunt fmt]] |
* <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> | ||
− | |||
− | |||
− | |||
− | |||
== See also == | == See also == | ||
* {{terraform fmt}} | * {{terraform fmt}} | ||
+ | * {{fmt}} | ||
[[Category:Terraform]] | [[Category:Terraform]] |
Advertising: