nerdexam
HashiCorp

TA-002-P · Question #296

While Terraform is generally written using the HashiCorp Configuration Language (HCL), what other syntax can Terraform are expressed in?

The correct answer is A. JSON. Terraform natively supports two configuration syntaxes: HashiCorp Configuration Language (HCL), which uses the .tf file extension, and JSON, which uses the .tf.json extension. JSON support exists primarily for machine-generated configurations and tool interoperability. YAML (B)…

Read, generate, and modify configuration

Question

While Terraform is generally written using the HashiCorp Configuration Language (HCL), what other syntax can Terraform are expressed in?

Options

  • AJSON
  • BYAML
  • CTypeScript
  • DXML

How the community answered

(48 responses)
  • A
    94% (45)
  • B
    2% (1)
  • C
    4% (2)

Explanation

Terraform natively supports two configuration syntaxes: HashiCorp Configuration Language (HCL), which uses the .tf file extension, and JSON, which uses the .tf.json extension. JSON support exists primarily for machine-generated configurations and tool interoperability. YAML (B) is used by tools like Kubernetes and Ansible but is not a native Terraform format. TypeScript (C) is used by the CDK for Terraform (CDKTF) as a higher-level abstraction, but CDKTF synthesizes down to JSON - it is not a native Terraform syntax. XML (D) is not supported by Terraform.

Topics

#Terraform syntax#Configuration language#HCL#JSON

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice