nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-003 · Question #12

Which command should you run to check if all code in a Terraform configuration that references multiple modules is properly formatted without making changes?

The correct answer is C. terraform fmt -check -recursive. This command will check if all code in a Terraform configuration that references multiple modules is properly formatted without making changes, and will return a non-zero exit code if any files need formatting. The other commands will either make changes, list the files that…

Tools for Test Analysts

Question

Which command should you run to check if all code in a Terraform configuration that references multiple modules is properly formatted without making changes?

Options

  • Aterraform fmt -write-false
  • Bterraform fmt -list -recursive
  • Cterraform fmt -check -recursive
  • Dterraform fmt -check

How the community answered

(28 responses)
  • A
    7% (2)
  • B
    4% (1)
  • C
    71% (20)
  • D
    18% (5)

Explanation

This command will check if all code in a Terraform configuration that references multiple modules is properly formatted without making changes, and will return a non-zero exit code if any files need formatting. The other commands will either make changes, list the files that need formatting, or not check the modules.

Topics

#Terraform#terraform fmt#code formatting#recursive modules

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-003 Practice