Which language does Terraform use for its configuration files?
- Python
- HCL (HashiCorp Configuration Language) ✓
- YAML
- JSON
Correct answer: HCL (HashiCorp Configuration Language)
Option B is correct because Terraform configuration files are written in HCL, HashiCorp Configuration Language, a purpose-built declarative language designed for human readability and machine parsing, used for all .tf files. Option A is incorrect because Python is a general-purpose programming language and is not the native configuration language for Terraform, though it can be used with the CDK for Terraform. Option C is incorrect because YAML is not the primary language for Terraform configurations; while some Terraform-adjacent tools use YAML, HCL is the standard for .tf files. Option D is incorrect because JSON is supported by Terraform as an alternative syntax for .tf.json files but is not the primary or recommended configuration language; HCL is the default.
Topic: · terraform, hcl, infrastructure as code, configuration language