Infrastructure as code
Describing servers, networks and databases in files instead of clicking.
Infrastructure as code (IaC) means writing down the cloud resources you need in a text file and letting a tool create them. Instead of clicking through the AWS console to make a virtual machine, a bucket and a database, you write "one Amazon EC2 instance of this size, one Amazon S3 bucket with this name, one Amazon RDS database", run a command, and the tool makes the cloud match the file.
The big win is repeatability. The file lives in Git next to the application code, so every change is reviewed, has an author and can be undone. Need an identical staging environment? Run the same file again. Someone deleted a server by accident? Re-apply and it comes back. Clicking gives you none of that, and nobody remembers what was clicked six months ago.
The common tools are Terraform (works with every cloud, with its own language called HCL), AWS CloudFormation (AWS only, in YAML or JSON), Pulumi and the AWS CDK (both use regular programming languages). All of them compare what the file says with what exists and show a plan ("will create 2, change 1, destroy 0") before touching anything.
Keep in mind
- Infrastructure files are versioned, reviewed and reused like application code.
- Tools show a plan of changes before applying them.
- Terraform is multi-cloud; CloudFormation and CDK are AWS-native.
- "Drift" is when someone changes things by hand and the file no longer matches reality.
Go deeper
- What is infrastructure as code? (AWS)
- What is Terraform? (official docs)
- Infrastructure as code (Wikipedia)