Terraform

Sarthak Jain
2 min readJan 19, 2022

Terraform is an infrastructure as code (IaC) tool that allows you to build, change and version infrastructure safely and efficiently. This includes low-level components such as compute instances, storage, and networking, as well as high-level components such as DNS entries, SaaS features, etc.

How you can become a Terraform Ninja

  1. Why you should learn.
  2. Learn The Cloud First.
  3. Learn The basics of Terraform.
  4. Apply it!

Why you should learn: Terraform is intelligent enough to understand whether these resources need to be created, changed or destroyed. What this essentially means is to write once use any number of times across any number of environments. Terraform uses a declarative paradigm(tell it what to do and it will take care of the how part).

Learn The Cloud:

To understand Terraform. you must have few understanding of any Cloud(AWS,Azure,GCP). for instance you need an EC2 and you want to create through Terraform than in this case you must be aware with (what is EC2?,what is subnet ?,region and so on). It is not compulsory to be good in every Cloud. if you know any of one, that’s perfectly fine.

Learn The basics of Terraform: we should understand the basic principles,HashiCorp Configuration Language and core commands that are crucial for writing terraform.

  1. Understand Terraform File Structure.
  2. Basic Terraform Commands:
  • terraform init : Prepare your working directory for other commands
  • terraform validate : Check whether the configuration is valid
  • terraform plan : Show changes required by the current configuration
  • terraform apply : Create or update infrastructure
  • terraform destroy : Destroy previously-created infrastructure

Terraform Provider: Terraform provider is a Cloud vendor to which we want to integrate our resources. For instance: If you want to use Terraform with AWS, you’ll need the AWS provider. Or if you want to use GCP you’ll need the GCP provider.

Before run any command you need to configure Cloud Provider like aws configure.

--

--

Sarthak Jain

Hi! My name is Sarthak Jain(sɑːɾ.t̪ʰək). I’m a Software Developer living in India. I’m currently working on Python and ML and also love to explore new tech.