Infrastructure as Code: Lessons Learned
Infrastructure as Code transformed how we deploy and manage systems. But it also introduced new complexities — state management, drift detection, and the cognitive load of abstraction layers. Here are the lessons that stuck with me.
State is the real product
The code describes intent; the state describes reality. Most painful incidents I have seen trace back to a gap between the two. Treat your state file as a first-class artifact: back it up, lock it, and never edit it by hand.
Abstractions have a cost
Every module that hides detail also hides understanding. A good abstraction earns its keep. A clever one usually does not. When in doubt, prefer the version a tired colleague can read at 2am.