Difference between revisions of "Terraform fmt"

From wikieduonline
Jump to navigation Jump to search
Line 5: Line 5:
 
  [[terraform fmt -diff]]
 
  [[terraform fmt -diff]]
 
  [[terraform fmt -check]]
 
  [[terraform fmt -check]]
 +
[[terraform fmt -write -recursive]]
  
 
== Examples ==
 
== Examples ==

Revision as of 22:01, 8 September 2022

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

See also

Advertising: