Terraform-Associate-004 practice question 1 of 35
You should run terraform fnt to rewrite all Terraform configurations within the current working directory to conform to Terraform-style conventions.
Full set: 360 questionsThe statement is false because the command provided, terraform fnt, is incorrect. The correct command to rewrite Terraform configuration files to a canonical format and style is terraform fmt. The fmt command recursively scans the current directory and applies standard Terraform formatting conventions, such as alignment and spacing, to all .tf and .tf.json files it finds. Executing terraform fnt would result in an error, as it is not a valid Terraform CLI command.
The statement would be considered "True" only if the command were correctly written as terraform fmt. The typo (fnt instead of fmt) makes the entire statement factually incorrect, as the specified command does not exist and will not perform the described action.
1. HashiCorp Developer Documentation, "Terraform CLI - fmt Command": This official documentation page explicitly names the command as fmt. It states, "The terraform fmt command is used to rewrite Terraform configuration files to a canonical format and style." The page does not list fnt as a valid command or alias.
Source: HashiCorp, Terraform CLI Commands, "fmt". Retrieved from https://developer.hashicorp.com/terraform/cli/commands/fmt
2. HashiCorp Developer Documentation, "Format Configuration" Tutorial: This official tutorial guides users on code formatting. The first step instructs the user to "Run the terraform fmt command to format the configuration in your current directory." This reinforces that fmt is the correct command for this purpose.
Source: HashiCorp, Terraform Tutorials, "Format Terraform Configuration". Retrieved from https://developer.hashicorp.com/terraform/tutorials/cli/format
3. HashiCorp Developer Documentation, "Terraform CLI - Commands (Index)": The main index of all available Terraform CLI commands lists fmt but does not include fnt or any similar command, confirming that fnt is not a recognized command.
Source: HashiCorp, Terraform CLI, "Commands". Retrieved from https://developer.hashicorp.com/terraform/cli/commands
Keep practicing
Take the free Terraform-Associate-004 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other Terraform-Associate-004 practice questions
- Question 2Module variable assignments are inherited from the parent module and you do not need to e…
- Question 3terraform validate confirms thesyntaxof Terraform files.
- Question 4Using the terraform state rm command against a resource will destroy it.
- Question 5Variables declared within a module are accessible outside of the module.
- Question 6terraform init retrieves and caches the configuration for all remote modules.
- Question 7terraform validate uses provider APIs to verify your infrastructure settings.
