Infrastructure as Code
Infrastructure as code (IaC) is the practice of defining servers, networks, databases, and other cloud resources in machine-readable files instead of configuring them by hand in a console. The definition lives in a repository, so infrastructure changes go through the same review, history, and rollback as application code. A tool reads the files, compares them against the live environment, and applies only the changes needed to match. Because the same definition can be applied repeatedly with the same result, teams can rebuild an environment from scratch or spin up an identical staging copy on demand. Terraform and OpenTofu use a declarative configuration language, Pulumi and the AWS CDK let developers write the same definitions in TypeScript or Python, and Ansible handles configuration on existing machines. Pipelines usually run a plan step on a pull request so reviewers see exactly what will change before it is applied. The frequent pitfall is drift. Someone edits a resource manually in the console, the live state no longer matches the code, and the next apply either reverts that fix or fails outright. Teams limit console access and keep state files locked and backed up. IaC is a core DevOps practice and pairs directly with CI/CD.