HashiCorp Configuration Language (HCL) is a unique configuration language. It was designed to be used with HashiCorp tools, notably Terraform, but HCL

Introduction to HCL and HCL tooling

submited by
Style Pass
2022-01-13 08:00:07

HashiCorp Configuration Language (HCL) is a unique configuration language. It was designed to be used with HashiCorp tools, notably Terraform, but HCL has expanded as a more general configuration language. It’s visually similar to JSON with additional data structures and capabilities built-in.

When combined, the sub-languages form a well structured HCL configuration file. This structure helps accurately and easily describe environmental configurations necessary for the Terraform tool.

Recently, HCL has migrated away from using Version 1 of the language in favor of Version 2. This post assumes we're talking about HCL2 instead of HCL1.

HCL2 is a combination of HCL and the HashiCorp Interpolation Language (HIL). HIL adds string interpolation and a greater ability to use functions in variable declarations.

HCL can also be used with tools other than just Terraform. Over time different parsers have become available, such as Go, Java, and Python. In this post, I discuss getting started using HCL and which tools take advantage of its unique features.

Leave a Comment