DEV Community

Cover image for Getting started with Infrastructure as Code (IaC)
Adithya Krishna
Adithya Krishna

Posted on

Getting started with Infrastructure as Code (IaC)

Infrastructure as Code (IaC) tools allow you to manage your infrastructure using configuration files rather than through a graphical user interface. IaC allows you to build, modify, and manage your infrastructure in a secure, consistent, and repeatable way by defining resource configurations that you can version, reuse, and share.

Currently, in the tech world, there are many IaC tools and These are a few popular choices:

  • Chef
  • Otter
  • Puppet
  • Ansible
  • Pulumi
  • Terraform

IaC Tools

There are 2 different approaches for Infrastructure as Code tools,

  1. A declarative approach defines the desired state of the system, including what resources you need and any properties they should have, and an IaC tool will configure it for you.

  2. An imperative approach instead defines the specific commands needed to achieve the desired configuration, and those commands then need to be executed in the correct order.

Along with the approaches, there are 2 methods

  1. Push: The control server sends the configuration to the target system
  2. Pull: The configured server pulls its configuration from the control server

IaC Details

The advantages of IaC tools are,

  • Reduce expenses and other related costs
  • Faster deployment speeds
  • Error Reduction
  • Consistent Infrastructures
  • Eliminate configuration drift
  • Allows infrastructure to be easily integrated into version control systems
  • Provides the ability to introduce extensive automation for infrastructure management
  • Eliminates the need for manual infrastructure provisioning and management

IaC vs IaaS

IaC is not a derivative of infrastructure as a service (IaaS). These are two completely different concepts.

Infrastructure as a Service is one of the core cloud services: virtualised computing resources—servers, networking infrastructure, storage, etc.—are provided via the cloud service.

Infrastructure as Code is a tool that can be used to provision and manage infrastructure. It is not limited to only cloud-based resources. In fact, you apply IaC to a wide variety of environments, including on-premises.

References:

  1. https://www.redhat.com/en/topics/automation/what-is-infrastructure-as-code-iac
  2. https://learn.hashicorp.com/tutorials/terraform/infrastructure-as-code?
  3. https://en.wikipedia.org/wiki/Infrastructure_as_code
  4. https://www.bmc.com/blogs/infrastructure-as-code/

Top comments (0)