What is Infrastructure as code and Which IAC tool to use?


If you go back two decades, everyone used those physical servers (produced by IBM, HP, and Cisco) which took weeks to setup correctly before we could run the applications on them.

Then came the time of virtualization, Sharing computing resources across multiple OS installations using hypervisor-based virtualization technologies such as VMware became the new normal. It reduced the time to spin up a server to run your application but also increased complexity.

Subsequently, we got AWS which revolutionized computing and a new era of cloud computing became streamlined. After AWS, other big tech companies such as Microsoft and Google launched their cloud offerings named Azure and Google Cloud Platform respectively.

In the cloud, you can spin up a server in a few minutes with just a few clicks. Creating and managing a few servers was very easy but as the number of servers and their configurations grew, manual tracking became a significant challenge.

Below were the challenges before IAC

  • Reproducibility and Disaster Recovery: Reproducing complex infrastructure setups or recovering from disasters was a challenging task without a defined and automated process.
  • Limited Collaboration and Siloed Operations: In traditional infrastructure management, teams were often organized in silos, resulting in limited collaboration between development and operations.
  • Lack of Scalability and Flexibility: Scaling infrastructure resources traditionally required significant effort and time.
  • Inconsistency and Configuration Drift: When infrastructure is manually set up and configured, inconsistencies can arise across various environments, leading to the phenomenon known as configuration drift.
  • Lack of Visibility and Auditability: There was no visibility into the state of infrastructure and changes made over time.
  • Manual and Error-Prone Processes: Traditional infrastructure management involves repetitive manual tasks prone to human errors.

Introducing IAC — Infrastructure as code

Infrastructure as Code (IaC) is a combination of standards, practices, tools, and processes to provision, configure, and manage computer infrastructure using code and other machine-readable files.

IAC is the process of provisioning and managing infrastructure defined through code. The code can be any of below

  • Scripting — Python
  • Configuration management tools — Chef, Puppet, and Ansible.
  • Provisioning tools — Terraform, AWS CloudFormation.
  • Containers and templating tools — Docker, Vagrant.

IAC solved all the above-mentioned challenges and added a ton of additional benefits.

  • Improved visibility, auditability, and security — Can store IAC code in a version control system such as git where they can be monitored for the changes made to infra over time.
  • Scalability and Flexibility — Organizations can easily provision additional resources, scale up or down, and replicate environments consistently across various stages of the software development lifecycle.
  • Reusability — Same code can be used to create infra for different environments, and we can modularize your code for other use cases and needs.
  • Faster Disaster Recovery — During zonal outages, existing infrastructure can easily be completely recreated in a very short time
  • Improved efficiency — Eliminates manual provisioning and configuration, reducing human errors and improving efficiency.
  • Increased reliability — IAC can help to reduce the risk of human error by automating the provisioning and configuration of infrastructure.
  • Improved Collaboration and Agility — It can help organizations to be more agile by making it easier to change and update infrastructure. IAC promotes collaboration between development and operations teams with shared code repositories and version control systems.

Which IAC tool to use?

There are many viable options available such as AWS CloudFormation, Azure Resource Manager, Google Cloud Deployment Manager, Terraform, Pulumi, etc, but Terraform is clearly the winner.

Some people also add Ansible, Chef, and Puppet to the list but they are more of a configuration management tool than Infrastructure management tools.

What is Terraform, and how Terraform became synonymous with IAC?

Akhilesh Mishra

Akhilesh Mishra

I am Akhilesh Mishra, a self-taught Devops engineer with 11+ years working on private and public cloud (GCP & AWS)technologies.

I also mentor DevOps aspirants in their journey to devops by providing guided learning and Mentorship.

Topmate: https://topmate.io/akhilesh_mishra/