Mental Model to Explain Terraform

Ravi Kumar
2 min readFeb 13, 2022

In this post I have break down the curse of complexity of Terraform and created a model of Terraform in a way that sticks with early learner .

Photo by Jefferson Santos on Unsplash

So Why Terraform ?

HashiCorp Terraform is Day 1 & Day 2 + , Well Day 1 is when you starting from the scratch which means you are building or provisioning your infrastructure & Day 2 + is when we start modifying or evolving the infrastructure which we build on Day 1.Terraform solve this problem by defining your planning of build, modification & versioning life cycle safely and securely by Infrastructure of code Approach. Which means you can write and define what you need and what you want to change in declarative & human readable configuration files.

Mental Model for Terraform

While I strongly suggest to go through the https://www.terraform.io/intro for detail information and use above mental model to map each of the topic , It will help you to create a flow chart inside your busy brain and make every thing stick to your memory. Try it !!

Some Core Concepts

Provider : Providers enable Terraform to work with virtually any platform or service with an accessible API. It’s a translation layer to communicate Terraform with cloud provider, database & many different services.

State file : Terraform “terraform.tfstate” is the heart of the overall operation. It holds the currents states about your managed infrastructure and configuration , In short what resources you created and updated before , Terraform have it all.

The core Terraform workflow has three steps:

Write - Define what resource you desire to create/update, write code.

Plan- It’s a execution plan , which lets you preview the changes Terraform Plans to make to your infrastructure.

Apply- It’s the action time, Terraform execute the action plan defined in Terraform Plan.

I hope it will help you to become an effective and better Terraform Developer , Good Luck !!

--

--