Infrastructure as code (IaC) means describing servers, networks, databases and permissions in files that a tool reads to build the environment, instead of creating them by clicking through a console. AWS describes it as "applying the same rigor of application code development to infrastructure provisioning", with configurations "defined in a declarative way and stored in a source control system" (Introduction to DevOps on AWS).
Common tools on AWS
| Tool | How you write it | Notes |
|---|---|---|
| AWS CloudFormation | YAML or JSON templates | No additional charge for AWS resource types; third-party extensions are charged per operation |
| AWS CDK | Familiar programming languages, turned into CloudFormation | Suits teams that prefer code to templates |
| AWS SAM | Short templates for serverless applications | Built on CloudFormation |
| Terraform (and CDK for Terraform) | HCL or code | Third-party; works across AWS and other providers |
Why it matters
- Repeatability. The same file builds test, production and a recovery copy, so they don't drift apart.
- A record of change. Every change is a reviewed commit, which shows who changed what and when.
- Recovery. AWS's disaster recovery guidance names CloudFormation and the CDK as the way to deploy infrastructure into a recovery Region. In a pilot light design the application tier exists only as code until failover, so the templates are the recovery plan.
Practical limits
- Manual changes undo the benefit. A fix made in the console and never copied back to the code is lost on the next rebuild. Treat console changes in production as exceptions to record.
- Code is not data. IaC rebuilds the environment, not its contents; you still need backups and replication.
- Untested templates rot. A template last run two years ago may fail against current service versions or quotas. Rebuilding from it in a disaster recovery test is the only proof it works.
For UK financial services firms, IaC turns "we could rebuild it" into something you can show: a reviewed change history and a measured rebuild time are useful evidence for operational resilience self-assessments. It also underpins an AWS landing zone. For how the code-only parts of each DR pattern affect recovery time, see AWS Disaster Recovery Strategies. Building recovery environments as code is part of a Yemberzal disaster recovery engagement.