An uncomfortable question
Imagine that tomorrow somebody deletes an entire environment by mistake: networks, servers, databases, access rules. The data is safe in its backups, but the infrastructure around it no longer exists. How long does it take to have it back exactly as it was?
In many organisations the honest answer is 'we do not know', followed by 'days, and it would not be the same'. Nobody remembers all the network rules, the sizes chosen, the adjustments made by hand over the years.
Infrastructure as code
The alternative is to describe the whole infrastructure in text files: which networks exist, which servers, at what size, which rules protect them. Those files are kept in a repository, reviewed like an application's code, and a tool takes care of making reality match the description.
With that, rebuilding stops being a feat and becomes a command. And along the way you gain everything else:
- History: every change has an author, a date and a reason.
- Review: a network change is reviewed before being applied, just like a code change.
- Repetition: development, acceptance and production all come from the same code, with different parameters.
- Documentation that does not lie: the code is the description of what exists.
What this series covers
From the problem of clicks to declaring the desired state; from the infrastructure's code (its state, its modules, the plan before applying and its cost) to keeping every server as it should be and detecting when it drifts; from how to change without fear (rollback, rules as code, bringing in what you inherited) to automating daily operations. And, at the end, what is best not automated.
Let us start at the origin of the problem: clicks.
How we apply it: Automation and IaC.