nerdexam
HashiCorp

TA-002-P · Question #353

terraform validate validate validates that your infrastructure matches the Terraform state file.

The correct answer is B. False. False. 'terraform validate' checks that your configuration files are syntactically valid and internally consistent - it verifies that resource types exist, required arguments are provided, and references are valid. It does NOT compare your infrastructure against the state file or

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

Question

terraform validate validate validates that your infrastructure matches the Terraform state file.

Options

  • ATrue
  • BFalse

How the community answered

(23 responses)
  • A
    4% (1)
  • B
    96% (22)

Explanation

False. 'terraform validate' checks that your configuration files are syntactically valid and internally consistent - it verifies that resource types exist, required arguments are provided, and references are valid. It does NOT compare your infrastructure against the state file or against live cloud resources. To reconcile state with real infrastructure, use 'terraform refresh' (or 'terraform apply -refresh-only'). To see what changes would be made, use 'terraform plan'.

Topics

#terraform validate#CLI commands#Configuration validation#State file

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice