Skip to content

glossary

Infrastructure as Code (IaC)

The practice of defining servers, networks, and cloud resources in machine-readable code instead of manual clicks, so infrastructure can be versioned, reviewed, tested, and recreated identically on demand.

In depth

Infrastructure as Code replaces console clicking and hand-run scripts with declarative or programmatic definitions of infrastructure stored in version control. With tools like Terraform or OpenTofu you declare the resources you want, a VPC, a Kubernetes cluster, a database, and the tool computes a plan to create or modify cloud resources to match. Because the definitions are plain text, they get the full software workflow: pull request reviews, automated validation, security policy checks, and CI/CD pipelines that apply changes. IaC makes environments reproducible, so staging can be a faithful copy of production and disaster recovery becomes re-running code rather than archaeology. It also eliminates configuration drift and 'snowflake servers' that nobody dares touch. Declarative tools (Terraform, CloudFormation) describe the end state, while configuration management tools (Ansible, Chef) and general-purpose options (Pulumi, CDK) offer imperative or programming-language approaches.

Why it matters

Manual infrastructure does not scale, cannot be reliably reproduced, and leaves no audit trail. IaC turns infrastructure into a reviewable, testable artifact, making disaster recovery, multi-environment consistency, and compliance evidence dramatically easier. It is a baseline expectation for nearly every modern infrastructure role.

Real-world example

example.txt

A startup defines its entire AWS footprint in Terraform modules: VPC, EKS cluster, RDS, and IAM roles. When they expand to a second region for resilience, they instantiate the same modules with new variables and have a working replica in an afternoon, instead of weeks of error-prone console work.

Tools related to Infrastructure as Code (IaC)

TerraformOpenTofuPulumiAWS CloudFormationAnsibleCrossplane

Interview questions

  1. What problems does Infrastructure as Code solve compared to manual provisioning?
  2. Explain Terraform state. Why does it exist and how do you manage it in a team?
  3. Compare declarative and imperative IaC approaches.
  4. How do you structure Terraform code for multiple environments?
  5. What is configuration drift and how do you detect and prevent it?
  6. How would you test infrastructure code before applying it to production?