TERRAFORM-ASSOCIATE-004 · Question #176
Multiple team members are collaborating on infrastructure using Terraform and want to format the* Terraform code following standard Terraform-style convention. How should they ensure the code satisfie
The correct answer is C. Use terraform fmt. The terraform fmt command is used to format Terraform configuration files to a canonical format and style. This ensures that all team members are using a consistent style, making the code easier to read and maintain. It automatically applies Terraform's standard formatting conven
Question
Options
- ATerraform automatically formats configuration on terraform apply
- BRun terraform validate prior to executing terraform plan or terraform apply
- CUse terraform fmt
- DReplace all tabs with spaces
How the community answered
(21 responses)- B5% (1)
- C90% (19)
- D5% (1)
Explanation
The terraform fmt command is used to format Terraform configuration files to a canonical format and style. This ensures that all team members are using a consistent style, making the code easier to read and maintain. It automatically applies Terraform's standard formatting conventions to your configuration files, helping maintain consistency across the team's codebase.
Topics
Community Discussion
No community discussion yet for this question.