nerdexam
HashiCorpHashiCorp

TA-002-P · Question #441

TA-002-P Question #441: Real Exam Question with Answer & Explanation

The correct answer is D: terraform fmt -check -recursive. -check Check if the input is formatted. Exit status will be 0 if all input is properly formatted and non-zero otherwise. -recursive Also process files in subdirectories. By default, only the given directory (or current directory) is processed.

Use the Terraform CLI (terraform plan, apply, destroy, fmt, init, validate, workspace, import, taint, providers, output)

Question

To check if all code in a Terraform configuration with multiple modules is properly formatted without making changes, what command should be run?

Options

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

Explanation

-check Check if the input is formatted. Exit status will be 0 if all input is properly formatted and non-zero otherwise. -recursive Also process files in subdirectories. By default, only the given directory (or current directory) is processed.

Topics

#terraform fmt#code formatting#CLI commands#modules

Community Discussion

No community discussion yet for this question.

Full TA-002-P PracticeBrowse All TA-002-P Questions