Skip to content
Welcome To Charanjit Cheema Blog

Welcome To Charanjit Cheema Blog

An Open Source and Cloud Blog

Menu
  • Home
  • About Me!
  • Way to my Technical Blog
  • Contact me
  • Privacy Policy
Menu

Terraform – A new way of provisioning and managing Datacenter Infrastructure.

Posted on November 17, 2018March 1, 2023 by Charanjit Cheema

Terraform has become hot topic now days. In few years this tool has gain its popularity worldwide, many have adopted it as it has proven good progress which made this tool one of an essential tool of DevOps tool chain. Have a look the Google trend you will get picture how much popularity it has gain.

 

So What is Terraform why it so much popular?
Terraform is a one of the example of infrastructure as a code software developed by HashiCorp. It enable the user to build datacenter infrastructure with the help of high level configuration language on Private Cloud such as OpenStack or on Public Clouds like AWS, Microsoft Azure, Google Cloud Platform, IBM Cloud (formerly Bluemix), Oracle Cloud Infrastructure, or VMware vSphere Infrastructure.

With few commands or codes you can deploy or manage whole infrastructure in Cloud for example, below code will configure a server (instance) on Amazon Web Services:

provider "aws" {
region = "us-east-1"
}
resource "aws_instance" "example" {
ami = "ami-40d28157"
instance_type = "t2.micro"
}

And to deploy it, you just run one command:

> terraform apply

Terraform is more simple but it is more powerful which made it an emerging key player in the DevOps world. It automate the lot of System Admin tasks by removing tedious and manual work which is prone to human error. Good thing with these automate tasks is that it can be compliant with DevOps practices e.g., automated testing, continuous integration, continuous delivery

How Terraform works?
Terraform is an open source tool which is written in Go programming language. Terraform can easily be compiled with Go programming language in binary with same name that is Terraform. Terraform binary codes are easily to comprehend though you are not from programming background. Terraform can authenticate and connect with different cloud providers like AWS, Azure, Google Cloud, DigitalOcean, OpenStack etc. through API calls and API authentication mechanism (eg. API keys are used to authenticate with AWS) and can provision the infrastructure to cloud providers on your behalf.

Terraform configuration capable to make API calls it has text files that contain codes which defines what infrastructure you want to create. Codes may defines the compute resources at low level like instances, storage and networking also at high level it manage components such as DNS entries, SaaS features, etc. An example of Terraform configuration as below:

resource "aws_instance" "example" {
ami = "ami-40d28157"
instance_type = "t2.micro"
}

resource "dnsimple_record" "example" {
domain = "example.com"
name = "test"
value = "${aws_instance.example.public_ip}"
type = "A"
} 

In above configuration you can see codes can create instance in AWS first and then after perform DNS entries in AWS Route53.

 

 

Figure: Terraform binary translates the contents of your configurations into API calls to cloud providers. To push terraform binary you only need a laptop or computer which connects with Cloud providers through API plugins  Source: O’reilly

Key features of Terraform

Infrastructure as Code: The Infrastructure as a code is just like a programming scripts which is developed for automate the IT process. Codes are written in high level language or any descriptive language use to automate the series of static steps which must be repeated numerous times across multiple servers. Additionally infrastructure can be shared and re-used.

Execution Plans: This is called Terraform planning phase where it generates the execution plan. In execution plan phase it shows how Terraform will do when you call apply. This phase save from errors or mistakes which can occur when Terraform manipulates the infrastructure.

Resource Graph: Terraform builds a graph of all your resources, and parallelizes the creation and modification of any non-dependent resources. Because of this, Terraform builds infrastructure as efficiently as possible, and operators get insight into dependencies in their infrastructure.

Change Automation: With less human intervention complex changes can been applied with the help of execution plan and resource graph you will be ascertain for changes implemented by Terraform which avoid many possible human errors.

Reference Sources:
https://www.oreilly.com/library/view/terraform-up-and/9781491977071/ch01.html
https://medium.com/devopslinks/why-should-terraform-be-one-of-your-devops-tools-29ae15861b1f
https://www.terraform.io/intro/index.html

Loading

  • Author
  • Recent Posts
Charanjit Cheema
Follow him
Charanjit Cheema
Charanjit is currently working as a Cloud Architect at Mphasis, with 17 years of experience in IT infrastructure projects, implementation, and support. While his main role is as a DevOps engineer, he holds a Cloud Architect position and has strong skills in cloud technologies and automation. His expertise includes Terraform, Ansible, AWS, Azure DevOps, Azure Cloud, VMware, and Linux systems.

Charanjit is passionate about automating tasks and improving processes. He uses tools like Terraform and Azure DevOps to build and manage cloud infrastructure and streamline deployment. He also enjoys using Shell scripts and Ansible playbooks to make systems run more efficiently.

In his free time, Charanjit enjoys learning about new technologies and sharing his knowledge through his blog. When he’s not working, he likes listening to music, having a cup of coffee, and relaxing in nature.

You can connect with Charanjit on Twitter, Facebook, LinkedIn, or email him at charanjit.cheema@cjcheema.com.
Charanjit Cheema
Follow him
Latest posts by Charanjit Cheema (see all)
  • How to optimize the performance of Ansible Automation Platform or Ansible Tower - July 16, 2023
  • How to fix code and text file linting errors with the help of Visual Studio Code - June 27, 2023
  • How to migrate existing WordPress blog from AWS EC2 instance to Amazon Lightsail - May 29, 2023

Like this:

Like Loading...

Related

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Tags

AWS Cloud Computing Dockers Networking Open Networking OpenSource RHEL-CentOS SDN Server Hardware SLES tcpdump Ubuntu WSL

Follow me @

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 2 other subscribers

Recent Posts

  • How to Deploy Docker Containers with NGINX on AWS EC2 Using Ansible and GitHub Actions
  • No More DynamoDB! Use Native S3 locking for Terraform State
  • How to Bring and Manage Manually Created AWS Resources Under Terraform Management
  • Iterating Cloud Resource Provisioning Using Terraform Count and For_Each Meta-Arguments
  • Terraform and Ansible Collaboration for AWS Cloud Deployment

Recent Comments

  1. Charanjit Singh on Terraform and Ansible Collaboration for AWS Cloud Deployment
  2. christinatodd2020aeaa798563 on Terraform and Ansible Collaboration for AWS Cloud Deployment
  3. Charanjit Singh on How to Set password policy in CentOS or RHEL system
  4. SAURABH on How to recover or rebuild initramfs in CentOS 7 Linux
  5. Sangita on How to Set password policy in CentOS or RHEL system

Archives

  • April 2025
  • February 2025
  • January 2025
  • August 2024
  • July 2024
  • June 2024
  • January 2024
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • September 2022
  • August 2022
  • July 2020
  • May 2020
  • February 2020
  • November 2019
  • June 2019
  • May 2019
  • March 2019
  • February 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • June 2018
  • May 2018
  • April 2018

Categories

  • Automation
  • Cloud Computing
  • Coding
  • CyberSecurity
  • Networking
  • OpenSource
  • RHEL-CentOS
  • Server Hardware
  • SLES
  • Technical Blog
  • Ubuntu
  • WSL

Blog Stats

  • 18,353 hits
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Home
  • About Me!
  • Way to my Technical Blog
  • Contact me
  • Privacy Policy
© 2025 Welcome To Charanjit Cheema Blog | Powered by Superbs Personal Blog theme
 

Loading Comments...
 

    %d