TA-002-P · Question #131
Which one of the following command will rewrite Terraform configuration files to a canonical format and style.
The correct answer is D. terraform fmt. terraform fmt rewrites all .tf and .tfvars files in the current directory (and optionally recursively) to conform to the Terraform canonical style - consistent indentation, spacing, and formatting. It is analogous to gofmt for Go code. terraform graph (C) and terraform graph -h (
Question
Which one of the following command will rewrite Terraform configuration files to a canonical format and style.
Options
- Aterraform graph -h
- Bterraform init
- Cterraform graph
- Dterraform fmt
How the community answered
(40 responses)- A3% (1)
- B3% (1)
- C5% (2)
- D90% (36)
Explanation
terraform fmt rewrites all .tf and .tfvars files in the current directory (and optionally recursively) to conform to the Terraform canonical style - consistent indentation, spacing, and formatting. It is analogous to gofmt for Go code. terraform graph (C) and terraform graph -h (A) generate a visual dependency graph of resources. terraform init (B) initializes a working directory by downloading providers and modules.
Topics
Community Discussion
No community discussion yet for this question.