Skip to main content

Command Palette

Search for a command to run...

Why Terraform is a sought-after IaC tool

Updated
2 min read
Why Terraform is a sought-after IaC tool

Let’s discuss the features of Terraform on a high-level. It is a free and open source tool developed by Hashicorp which helps to build, manage and destroy infrastructure within minutes

Major advantage - it be used to deploy infrastructure on multiple platforms like Cloud service providers, Vmware and other vendors

How does it manage infrastructure on third party platforms - through providers (API) It supports hundreds of providers and can work with almost any platforms

The language it uses – Hashicorp Configuration Language – a simple declarative language used to define infrastructure resources to be provisioned as blocks of code. The config file has a extension of .tf

[Note: HCL is used in version 0.11 and earlier]

It is an easy to read, write and understand even for a beginner

What is declarative mean? The code we define is the state that we want the infrastructure to be in.

How does Terraform move from current state to desired state? There are three phases of operation

  • Init --→ It initializes the project and identifies the providers for the target environment.
  • Plan --→ Drafts a plan to move from current state to desired state.
  • Apply --→ Performs the necessary changes on target environment to the desired state

    If the target environment shifts from the desired state for any reason, the subsequent apply moves the tgt environment to desired state by fixing the missing part.

Any object that Terraform manages is called a resource. Manages the lifecycle of the resource from provisioning, managing to decommissioning.

It records the state of the infrastructure as it is in the real world and based on it it determines what action is needed while updating resources on a certain platform. It can ensure that the infrastructure is always in the desired state.

State ---→ blueprint of infrastructure deployed by Terraform.

It can read attributes of existing infrastructure by configuring data sources and can be used by Terraform to configure other resources.

Terraform Cloud and Terraform Enterprise provide additional features for simplified collaboration between teams managing infrastructure, improved security and centralized UI for managing TF deployments.

These features make it an excellent infrastructure provisioning tool.

More from this blog

The Continuous Journey

24 posts