nerdexam
HashiCorp

TA-002-P · Question #415

Terraform console provides an interactive command-line console for evaluating and experimenting with expressions. You can use it to test interpolations before using them in configurations and to…

The correct answer is D. Declaring a resource identifier more than once. terraform validate checks the configuration files for internal consistency and correctness - it validates syntax, required arguments, attribute types, and resource/module references without accessing any remote state or APIs. Declaring a resource identifier more than once is…

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

Question

Terraform console provides an interactive command-line console for evaluating and experimenting with expressions. You can use it to test interpolations before using them in configurations and to interact with any values currently saved in state. Which configuration consistency errors does terraform validate report?

Options

  • AA mix of spaces and tabs in configuration files
  • BDifferences between local and remote state
  • CTerraform module isn't the latest version
  • DDeclaring a resource identifier more than once

How the community answered

(31 responses)
  • A
    3% (1)
  • B
    6% (2)
  • C
    3% (1)
  • D
    87% (27)

Explanation

terraform validate checks the configuration files for internal consistency and correctness - it validates syntax, required arguments, attribute types, and resource/module references without accessing any remote state or APIs. Declaring a resource identifier more than once is exactly the kind of configuration error it catches. It does NOT check whitespace or formatting (that is terraform fmt). It does NOT compare local vs. remote state (that is terraform plan). It does NOT check if modules are up to date. Answer D is correct.

Topics

#terraform validate#CLI commands#configuration consistency#syntax checking

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice