Learn about the HCL and its major components.


The first step required for provisioning infrastructure using Terraform is to define the infrastructure in a series of configuration files. Writing configuration files for Terraform can be achieved using either of the two formats below:

  • JSON
  • HCL


We can write Terraform configuration files using JSON, however, the syntax can be quite complex and cumbersome. Configuration files defined in the JSON format usually have the file extension .tf.json. A sample configuration written in JSON format is given below.

Get hands-on with 1200+ tech skills courses.