What is Infrastructure as Code (IaC)?

Answer

Infrastructure as Code (IaC) is the practice of defining and managing cloud and on-premises infrastructure through machine-readable configuration files rather than manual processes. Instead of clicking through a cloud console, you write code that describes the desired state of your infrastructure. Benefits: Consistency: the same code produces identical environments every time. Version control: infrastructure changes are tracked in Git with history, blame, and rollback. Automation: integrate with CI/CD pipelines for automated provisioning. Documentation: code is self-documenting infrastructure. Disaster recovery: recreate entire environments from code. Popular IaC tools: Terraform (multi-cloud), AWS CloudFormation, Azure Bicep/ARM, Pulumi (general-purpose languages), Ansible (configuration management). IaC is a foundational DevOps and SRE practice.