nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-003 · Question #95

Which of these commands makes your code more human readable?

The correct answer is D. Terraform fmt. The command that makes your code more human readable is terraform fmt. This command is used to rewrite Terraform configuration files to a canonical format and style, following the Terraform language style conventions and other minor adjustments for readability. The command is…

Use the Terraform CLI (outside of core workflow)

Question

Which of these commands makes your code more human readable?

Options

  • ATerraform validate
  • BTerraform output
  • CTerraform show
  • DTerraform fmt

How the community answered

(39 responses)
  • A
    5% (2)
  • B
    3% (1)
  • C
    13% (5)
  • D
    79% (31)

Explanation

The command that makes your code more human readable is terraform fmt. This command is used to rewrite Terraform configuration files to a canonical format and style, following the Terraform language style conventions and other minor adjustments for readability. The command is optional, opinionated, and has no customization options, but it is recommended to ensure consistency of style across different Terraform codebases. Consistency can help your team understand the code more quickly and easily, making the use of terraform fmt very important. You can run this command on your configuration files before committing them to source control or as part of your CI/CD pipeline.

Topics

#terraform fmt#code formatting#CLI commands#readability

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-003 Practice