Infrastructure as Code, Done Properly
Defining servers, networks and services in version-controlled files rather than configuring them by hand.
On this page
What is at stake
Hand-configured infrastructure cannot be reproduced or reviewed, and it drifts until nobody knows how it works.
The playbook
- Define infrastructure in code
- Review infrastructure changes
- Rebuild environments from definitions regularly
- Keep secrets out of definition files
- Detect and correct drift
Where it goes wrong
Avoid:
- Manual console changes
- Undocumented infrastructure
- Secrets committed to repositories
- One-off servers nobody can rebuild
The numbers behind it
| Measure | Figure |
|---|---|
| Declarative definitions | describe the desired state |
| Version control | changes are reviewed like code |
| Reproducibility | environments can be rebuilt from definitions |
| Drift | manual changes break the match with definitions |
Getting outside help
When to hand it over: Bring in help when infrastructure depends on one person's memory.
Where this comes from
- Microsoft Learn — Infrastructure as code
- OWASP — Infrastructure as Code Security Cheat Sheet
The figures and practices above come from the sources listed.
Working on something like this?
We take on Web Design & Development work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.
Where to go next
Spotted something wrong? Report an error on this page. We correct on the page and say what changed.