HCL block
A container in HCL written as a type, optional quoted labels and a body in braces, such as resource "local_file" "greeting" { }.
In more detail
The type, such as resource, variable or output, decides how many labels it needs and what may go inside. Blocks can contain arguments and other nested blocks, such as validation inside variable or lifecycle inside resource.
Related terms
- HCL — HashiCorp Configuration Language: the block-based configuration syntax of Terraform files, which end in .tf.
- HCL argument — A name, an equals sign and an expression inside a block, such as filename = "hello.txt", which sets one value.
- Terraform resource — A resource block, which asks Terraform to create and manage one piece of infrastructure such as a network, file or database.
Taught in
- Writing Your First Configuration In HCL — Infrastructure as Code with Terraform
- Functions And Expressions In HCL — Infrastructure as Code with Terraform
- The Plan That Wanted To Destroy Production — HashiCorp Terraform Associate (004) Exam Prep
- One Hour, No Weights Published — HashiCorp Terraform Associate (004) Exam Prep
- Providers: How Terraform Reaches Every API — HashiCorp Terraform Associate (004) Exam Prep
- Versions, The Lock File And Provider Aliases — HashiCorp Terraform Associate (004) Exam Prep
- State: Terraform's Memory Of What It Built — HashiCorp Terraform Associate (004) Exam Prep
- Write, Plan, Apply, And What Init Prepares — HashiCorp Terraform Associate (004) Exam Prep
- Reading A Plan, Saving It, Applying It — HashiCorp Terraform Associate (004) Exam Prep
- Validate, Format, Destroy, And The Flags That Bend A Plan — HashiCorp Terraform Associate (004) Exam Prep