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 questions
Answer options
A: True
B: False
Correct Answer:
FALSE
Explanation

The 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.

Why Incorrect

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.

References

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

Scroll to Top