Concept of Infrastructure as Code (IaC)

Anshu KumarAnshu Kumar
2 min read

In this document, we will understand the concept of Infrastructure as Code (IaC).

Imagine you're working as a DevOps engineer at Flipkart. Flipkart requires various compute resources such as RAM, CPU, and hardware.

Let’s say the company chooses AWS to manage these resources (like EC2, S3, and RDS). Instead of provisioning these services manually, engineers automate the process using scripts. As a result, whatever resources are needed (EC2, S3, RDS, etc.) can be deployed instantly using automation tools like the AWS CLI.


Automation Options in AWS

There are two commonly used options for automation in AWS:

  1. AWS CLI (Command Line Interface)

  2. AWS CloudFormation (CFT)

With these tools, infrastructure can be defined and provisioned automatically.


Cloud Portability Challenge

However, consider a scenario where the company decides to shift from AWS to Microsoft Azure. Scripts written using AWS CLI will not work in Azure, leading to compatibility issues.

Later, suppose the company wants to move to an on-premises setup. In that case, they might install OpenStack, and use Heat Templates to automate the infrastructure deployment.


Understanding the Hybrid Cloud Model

In a Hybrid Cloud Model, an organization uses multiple cloud providers. For example:

  • Company X uses AWS for storage services

  • Company X uses Azure for DevOps-related services

This model allows organizations to leverage the best offerings from multiple cloud providers.


The Problem with Too Many Tools

To manage multi-cloud and on-premises environments, engineers need to learn various tools and services like:

  • AWS CLI

  • AWS CloudFormation

  • Azure Resource Manager

  • OpenStack Heat
    ...and many more.

With over 100 cloud providers, it's not practical to master every tool individually.


The Solution – Terraform

To solve this problem, we use Terraform.

Terraform is a cloud-agnostic tool that allows you to define and provision infrastructure across multiple platforms using a single language and framework. It simplifies the process and eliminates the need to learn different tools for each cloud provider.

Conclusion

Infrastructure as Code (IaC) is revolutionizing how organizations manage their infrastructure by bringing automation, scalability, and efficiency. While native tools like AWS CLI, CFT, and Azure ARM templates are powerful, they tie you to specific cloud platforms.

To overcome this limitation and enable true cloud flexibility, tools like Terraform provide a unified, provider-independent approach. Learning Terraform empowers engineers to manage any infrastructure — whether it's AWS, Azure, GCP, or on-premises — using a single, consistent workflow.

IaC is not just a toolset — it's a fundamental skill in modern DevOps and cloud engineering.

0
Subscribe to my newsletter

Read articles from Anshu Kumar directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Anshu Kumar
Anshu Kumar

Hi, I'm Anshu Kumar, a passionate DevOps enthusiast with a solid foundation in Computer Science and hands-on experience in CI/CD, cloud infrastructure, and automation tools. I recently graduated with a B.Tech in CSE from Presidency University and have since been building real-world projects while upskilling in AWS, Linux, Terraform, Docker, Jenkins, and Kubernetes. I’ve interned as a SOC Analyst, gaining exposure to incident monitoring and log analysis, and I’ve also worked on web development projects that strengthened my understanding of full-stack architecture and DevOps deployment strategies. My recent DevOps projects include: A complete CI/CD pipeline for a Django app using Jenkins, Docker, GitHub, and Kubernetes (EKS). A cloud infrastructure monitoring tool using AWS Lambda, EC2, S3, and custom bash automation. A Digital India Subsidy portal designed for citizen-service integration and role-based access. Currently, I’m focused on mastering infrastructure as code (IaC), containerization, and cloud automation—while sharing what I learn here on Hashnode. 🔧 Tech I Use Cloud: AWS (EC2, IAM, S3, Lambda) IaC: Terraform, AWS CloudFormation Containers: Docker, Kubernetes CI/CD: Jenkins, GitHub Actions OS: Linux (Ubuntu,), Bash Monitoring/Logging: CloudWatch, custom logging scripts 📚 Certifications AWS DevOps Engineer – Professional (DOP-C02) Linux Administration Bootcamp DevOps Fundamentals