All glossary terms
Optimize

Infrastructure as code

Infrastructure as code (IaC) is the practice of defining and provisioning infrastructure, servers, networks, databases, IAM policies, through machine-readable declaration files rather than manual configuration.

IaC's value is reproducibility: a new environment (staging, disaster recovery, regional expansion) is a `terraform apply` away rather than a week-long manual setup. Equally important is reviewability, infrastructure changes go through PR review like code, with diffs that engineers can reason about. Common pitfalls: state-file management (Terraform's biggest operational hazard); drift (manual changes outside IaC); cyclic dependencies in modules. Modern alternatives (Pulumi, CDK) use general-purpose programming languages instead of DSLs, which trades the simplicity of HCL for the expressiveness of TypeScript or Python. The right answer depends on team familiarity.