Glossary Practice

Infrastructure as Code (IaC)

Infrastructure as Code (IaC) is the practice of defining cloud and on-premises infrastructure in machine-readable configuration files, then provisioning and changing it through automated tools rather than clicking through a console.

Infrastructure as Code (IaC) treats the description of infrastructure - virtual machines, networks, load balancers, IAM policies, Kubernetes clusters - the same way a codebase is treated. Configuration lives in version control, changes go through pull requests and review, and a tool reconciles the desired state in a file with the actual state in a cloud account.

Two broad styles exist:

  • Declarative: you describe the target state and the tool figures out the plan. Examples: Terraform, OpenTofu, Bicep, CloudFormation, Pulumi (mostly), Kubernetes manifests.
  • Imperative: you describe the steps, and the tool runs them in order. Examples: Ansible playbooks and shell scripts wrapping cloud CLIs.

The practical wins are auditability, reproducibility, and the ability to spin up a near-identical environment for staging, disaster recovery, or a customer-specific deployment. The cost is that infrastructure now has the same maintenance burden as application code: linting, testing, refactoring, and the occasional rewrite.