nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-004 · Question #95

Which of these commands makes your code more human readable?

The correct answer is D. Terraform fmt. terraform fmt (format) automatically reformats Terraform configuration files to follow the canonical HCL style conventions - consistent indentation, spacing, and alignment. This makes code more readable and consistent across teams. Option A (terraform validate) checks for configu

Submitted by marco_it· Apr 18, 2026Use Terraform CLI

Question

Which of these commands makes your code more human readable?

Options

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

How the community answered

(24 responses)
  • A
    8% (2)
  • C
    4% (1)
  • D
    88% (21)

Explanation

terraform fmt (format) automatically reformats Terraform configuration files to follow the canonical HCL style conventions - consistent indentation, spacing, and alignment. This makes code more readable and consistent across teams. Option A (terraform validate) checks for configuration errors but does not change formatting. Option B (terraform output) displays output values from state. Option C (terraform show) displays the current state or a saved plan in human-readable form, but does not modify source code formatting.

Topics

#Terraform CLI#Code formatting#HCL syntax#Readability

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-004 Practice