Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 235


Which of these commands makes your code more human readable?

Show Answer
Correct Answer: D

The `terraform fmt` command is used to format Terraform configuration files according to the standardized style. This ensures that the code is consistent, easier to read, and maintainable, making it more human-readable. The other commands serve different purposes: `terraform validate` checks for syntax errors, `terraform output` retrieves values of output variables, and `terraform plan` generates an execution plan. Therefore, `terraform fmt` is the correct answer.

Discussion

7 comments
Sign in to comment
MarshalLawOption: D
May 5, 2023

I would say D since it formats your code is a cleaner way to read code.

NobbieOption: B
May 6, 2023

It should be B Terraform Output https://developer.hashicorp.com/terraform/cli/commands/show#:~:text=The%20terraform%20show%20command%20is,state%20as%20Terraform%20sees%20it.

FawadK
May 10, 2023

Wrong. It cannot be B. The terraform output command is used to extract the value of an output variable from the state file.

FawadKOption: D
May 10, 2023

It's D. terraform fmt

JhaggarOption: D
May 13, 2023

The correct answer is D. terraform fmt is used to format the Terraform configuration files, making them more human-readable and consistent. This command applies a standard formatting style to your code, which helps to reduce errors and makes it easier to read and maintain. terraform validate is used to check the syntax and validate the Terraform code for errors. terraform plan is used to generate an execution plan that describes what Terraform will do when you apply the configuration. terraform output is used to retrieve the values of output variables defined in your Terraform configuration.

MantisOption: A
May 5, 2023

Terraform fmt: https://developer.hashicorp.com/terraform/cli/commands/fmt

Oleg_golOption: D
May 6, 2023

D. terraform fmt

PikopoOption: D
Sep 28, 2023

D is the correct answer