How to get infrastructure as code right
Every audit we run turns up some version of this. The short answer to infrastructure as code is that it is mostly a sequence of small decisions, not one big one.
The bill is a design document: it tells you exactly what your architecture actually does. The failure mode is not doing it wrong, it is doing it once and assuming it stays done.
The reason this keeps coming up
Clicking around a console is not a reproducible environment. The reasoning matters more than the rule, because the rule has exceptions. If two people in the business would answer this differently, that gap is the actual problem.
The steps
- Establish what you have today before changing anything
- Review infrastructure changes the same way you review code
- Rebuilding from scratch should be a routine operation
- Write down the decision so the next person does not re-litigate it
Rebuilding from scratch should be a routine operation. The reasoning matters more than the rule, because the rule has exceptions. Write the reasoning down alongside the decision, because the reasoning is what changes first.
A reasonable first step
What this looks like day to day
Cloud work rewards teams who automate early and punishes teams who click through consoles. Three things worth confirming about infrastructure as code before you move on:
- Someone can say what the current setup is without going to look
- Review infrastructure changes the same way you review code — and you know whether that is true here
- There is a way to tell whether the last change to this helped
The point is not perfection, it is knowing which of these you have consciously chosen to skip.