Md Zaman

StarTerraform: A Short IntroductionStar

Summary

Are you overwhelmed with boring environment of manual provisioning? It proves helpful by providing a rescue mission in the form of Hashicorp’s terraform which converts infrastructure management into a quick and effective procedure.

In this blog we will showcase the power of Terraform walk you through some of the simplest commands, set it up and implement some basic infrastructure so you can begin your journey on IaC.

Description

Introduction

Terraform is a IaC- Infrastructure as a Code. We can define infrastructure as a state.

E.g., In AWS we have EC2 instance, security groups, RDS, etc., all of these can be made/ provisioned using Terraform. We can define the state of these cloud resources and Terraform will ensure that same state.

Ansible, Puppet or Chef automates mostly OS related tasks like – what will be the state of the machines like what packages should be installed, what version, what configuration file. Terraform on the other hand maintain the state itself and also maintain its state like any Cloud provider- AWS, GCP, Azure, etc.,

Now Terraform, combining together with automation tools like Ansible can gives you complete automation.

So once your infrastructure is set up and if you’re provisioning EC2 instances, launching EC2 instances with TerraForm, you’d like to provision it with some software packages you can use Ansible, Puppet or Chef.

Otherwise, normal batch scripting is also fine with Terraform or even PowerShell scripting.

Installation

Installing Terraform is very easy. It’s available for Linux, Mac and also Windows.

You can just download the binary and you can store it in your path.

You can put in an environment variable in windows or you can export it in Linux or in Windows.

You can also do Choco install TerraForm.

First Exercise: Launch EC2 Instance