Learning DevOps
上QQ阅读APP看书,第一时间看更新

Formatting the code

Terraform has a command that allows the code to be properly aligned with Terraform's styles and conventions.

 The following command automatically formats the code:

terraform fmt

The following is a screenshot of a Terraform-arranged file:

The command re-formats the code and indicates the list of arranged files.

For more information on the Terraform style guide, refer to  https://www.terraform.io/docs/configuration/style.html, and for information about the terraform fmt command line, read  https://www.terraform.io/docs/commands/fmt.html.