nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-003 · Question #46

Running terraform fmt without any flags in a directory with Terraform configuration files check the formatting of those files without changing their contents.

The correct answer is B. False. Running terraform fmt without any flags in a directory with Terraform configuration files will not check the formatting of those files without changing their contents, but will actually rewrite them to a canonical format and style. If you want to check the formatting without…

Use the Terraform CLI (outside of core workflow)

Question

Running terraform fmt without any flags in a directory with Terraform configuration files check the formatting of those files without changing their contents.

Options

  • ATrue
  • BFalse

How the community answered

(38 responses)
  • A
    26% (10)
  • B
    74% (28)

Explanation

Running terraform fmt without any flags in a directory with Terraform configuration files will not check the formatting of those files without changing their contents, but will actually rewrite them to a canonical format and style. If you want to check the formatting without making changes, you need to use the -check flag.

Topics

#terraform fmt#code formatting#CLI behavior#idempotency

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-003 Practice