Terraform and Ansible for the Non-Technical

Evolving Development Paradigm

You Built it, You Fix it

IaC — Infrastructure as Code

Source: Terraform.io

Terraform and Ansible


  1. Refresh — In this step Terraform evaluates the current state of your infrastructure world and the target state of the infrastructure world as defined in the latest version of your infrastructure provisioning code. Example — It is Day1 and you would like to provision 3 AWS EC2 Resources. Refresh would find that there are 0 instances running (it is Day 1) and Terraform has been asked to create 3 instances of EC2
  2. Plan — In this step Terraform creates a graph that allows it to formulate the steps needed to be taken and in what sequence to make the target state match what is described in the provisioning code.Continuing our example, Terraform plans to create 3 EC2 Resources
  3. Apply — In this step Terraform executes the plan i.e. provisions and configures the EC2 Resources as per the plan. Terraform provisions 3 EC2 Resources
  4. Destroy — If for some reason you would want to bring down the infrastructure and de-allocate all the resources, then it can be done using the Destroy command. (Note that Destroy is a special type of apply. One could update the provisioning code to 0 instances and run through Refresh->Plan->Apply to the same effect.)
  1. IaaS — Infrastructure as a Service Ex — VmWare, Azure, AWS etc.
  2. PaaS — Platform as a Service Ex — Heroku, Amazon lambda etc.
  3. SaaS — Software as a Service Ex — Datadog, Github teams etc.


Terraform or Ansible?



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store