Infrastructure as Code (IaC) is the practice of defining infrastructure (networks, servers, databases, permissions and services) in machine-readable files that are version-controlled, reviewed and applied automatically, rather than configured by hand.

Because every cloud resource can be created through an API, the whole environment can be described as code. That changes infrastructure from something that is built once and carefully maintained into something that can be created, tested, destroyed and recreated at will.

Why it matters

Infrastructure as Code delivery loopCodein version controlPull requestand reviewPlan, policyand cost checksPipelineappliesEnvironmentsdev · test · prodDetect drift: fix the code, not the environment
Every infrastructure change flows through version control, review, automated checks and a pipeline. Drift is fixed in code.

Approaches and tools

IaC tools fall broadly into two styles:

Provider-native tools integrate most tightly with their cloud. Cross-cloud tools such as Terraform and OpenTofu offer one language across many providers and SaaS services. Pick one per estate and be consistent; the practices matter more than the tool.

Good practice

IaC is a foundation for the principles of immutable infrastructure and “don’t SSH in, build new”.