Systems & Backend

Infrastructure as Code

also: IaC · Terraform

Defining servers, networks, and services in version-controlled code instead of clicking through a console — reproducible infra.

Infrastructure as code (IaC) means declaring your infrastructure — servers, networks, databases, DNS — in version-controlled configuration files (Terraform, CloudFormation, Pulumi) that a tool applies, instead of manually clicking in a cloud console. Infra becomes reviewable, repeatable, and diffable.

Worked example: a Terraform file describes the whole environment; running it spins up an identical staging copy, and a code review shows exactly what a change will alter before it is applied. Gotcha: the tool tracks “state” (what it believes exists) — if someone changes infra by hand outside the tool (“drift”), the next apply may fight or revert it, so the discipline is that ALL changes go through the code; a corrupted or shared state file is a classic IaC footgun.