Member-only story
Terraweek Day 2Challenge
Introduction
The HashiCorp Configuration Language (HCL) is a configuration language authored by HashiCorp. HCL is used with HashiCorp’s cloud infrastructure automation tools, such as Terraform. The language was created to be both human and machine-friendly. It is JSON compatible, which means it is interoperable with other systems outside of the Terraform product line.
Terraform is an open-source tool written in the Go programming language.
Terraform Resources
Every provider comes with a set of resources. resource
, as the name suggests, represents the actual cloud resource to be created in the configuration language.
HCL Syntax Overview
HCL’s configuration syntax is easy to read and write. It was created to have a more clearly visible and defined structure.
HCL Blocks
A block is a container for other content. Blocks have a type
that can have zero or more required labels followed by { }
brackets that contain the block's body. Blocks can be nested inside each other.
Terraform Block Types
terraform
blockprovider
blockresource
blockvariable
blocklocals
blockdata
blockmodule
blockoutput
blockprovisioner
block