nerdexam
HashiCorp

TA-002-P · Question #374

terraform validate reports HCL syntax errors.

The correct answer is A. True. The terraform validate command checks for syntax errors within Terraform configuration files and also performs basic semantic validation.

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

Question

terraform validate reports HCL syntax errors.

Options

  • ATrue
  • BFalse

How the community answered

(34 responses)
  • A
    88% (30)
  • B
    12% (4)

Why each option

The terraform validate command checks for syntax errors within Terraform configuration files and also performs basic semantic validation.

ATrueCorrect

The terraform validate command performs checks to ensure that the configuration files are syntactically valid HCL (HashiCorp Configuration Language) and that they adhere to Terraform's general structural rules, including detecting syntax errors. It also performs some semantic validation, such as checking for valid attribute names and types where possible without needing external API calls.

BFalse

This statement is false because terraform validate is specifically designed to identify and report syntax errors in the HCL code.

Concept tested: Terraform configuration validation

Source: https://developer.hashicorp.com/terraform/cli/commands/validate

Topics

#terraform validate#HCL syntax#CLI commands#configuration validation

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice