Infrastructure as code

Definition
Infrastructure as Code (IaC) is the process of managing, provisioning, and configuring IT infrastructure through code rather than manual setups. Instead of using graphical interfaces or command-line inputs for each server or network, administrators define infrastructure requirements in machine-readable files. These definitions can then be version controlled, tested, and reused like application code.
IaC allows businesses to automate the creation and management of servers, networks, databases, and storage. By treating infrastructure as code, organizations reduce human error, achieve consistent environments, and accelerate deployments across development, testing, and production. Popular IaC tools include Terraform, Ansible, Puppet, and AWS CloudFormation.
Advanced
IaC can be applied in two models. Declarative defines the desired state of infrastructure, as seen in Terraform or CloudFormation. Imperative gives step by step instructions, as in Ansible or Chef. Declarative approaches align with GitOps, where infrastructure definitions live in repositories and updates are applied through pull requests.
IaC also integrates with CI and CD pipelines to automatically provision environments. It supports immutability, where resources are replaced instead of modified, helping avoid configuration drift. Advanced practices extend into policy as code for governance, compliance automation, and multi cloud orchestration.
Why it matters
Use cases
Metrics
Issues
Example
A financial services company uses Terraform to define infrastructure as code. Developers submit pull requests to update environments, and changes are automatically applied through CI and CD pipelines. This reduces manual effort, improves compliance visibility, and accelerates delivery of new services.