You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
HashiCorp Configuration Language (HCL) is the language used to write Terraform configuration files. This lesson covers HCL syntax, block structure, arguments, expressions, functions, and comments.
HCL files use the .tf extension. The language is designed to be:
HCL is built around blocks. Every block has a type, optional labels, and a body:
block_type "label_1" "label_2" {
argument = value
}
| Block Type | Labels | Purpose |
|---|---|---|
terraform | none | Terraform settings (providers, backend) |
provider | provider name | Provider configuration |
resource | type, name | Infrastructure resource |
data | type, name | Data source (read-only) |
variable | name | Input variable |
output | name | Output value |
locals | none | Local values |
module | name | Module call |
Arguments assign values inside blocks:
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.