Explain like I'm five · SRE

What is Infrastructure as Code?

Infrastructure as Code, told as a story about building a whole park from a single blueprint.

hmm... how did I build it last time...every time a new park goes up, someone builds it from memory, one at a time

Every time a new park goes up, someone builds it from memory, one at a time.And it comes out a little different, city to city.

City A Parkhas a boothCity B Parkno booth?build it by hand, and it turns out different each time...build it by hand, and it differs person to person, with no record of how

Build it by hand, and it differs person to person, with no record of how.City A's park and City B's park end up subtly different.

BLUEPRINT (CODE)ride: orange x1booth: x1queue: 4City ACity Bwith just one blueprint, you can build the exact same park anywherethe blueprint is the source of truth, not any one person

With just one blueprint, you can build the exact same park anywhere.The blueprint is the source of truth, not any one person.

Write the blueprint downas code
Anyone builds the same parkwith just the blueprint
Changes leave a recordwhat changed, and when
You can tell from the blueprint alonewhether it was built wrong
BLUEPRINTride: orange x1booth: x1queue: 4=✓City A✓City Bread the same blueprint, and even a different builder gets the identical result

Read the same blueprint, and even a different builder gets the identical result.And any change leaves a record in the blueprint's history.

BLUEPRINTride: x1matches the blueprintsecretly built one morereality has 2 — it no longer matchessecretly hand-edit it, and the blueprint no longer matches reality (drift)

Secretly hand-edit it, and the blueprint no longer matches reality (drift).And then there was no point writing the blueprint at all.

In one breath

Infrastructure as Code = writing the park's blueprint down as a single piece of code, so that whoever builds it, wherever, the result is the identical park.

Writing infrastructure like servers and networks as declarative blueprints (code) and keeping them under version control. A sneaky manual edit causes drift, where reality no longer matches the blueprint, and running the same blueprint again and again should always produce the same result (idempotency). GitOps is the next step — treating that blueprint repository as the one source of truth.

When grown-ups say it

Infrastructure as Code
Writing the blueprint down as a single piece of code. With just that blueprint, anyone builds the same park.
Declarative blueprint
A blueprint like "ride x1, booth x1". You write the desired result, not the steps to get there.
Drift
Reality no longer matching the blueprint. Happens when someone secretly hand-edits things.
Version control
A record of when and how the blueprint changed. You can always see later who changed what.
Reproducibility
The same blueprint always producing the same park. City A or City B, the result is the same.
Idempotency
Running the blueprint again and again gives the same result. Run it twice, and you still don't get two parks.
GitOps
A way where construction follows automatically when the blueprint changes. It automatically connects updating the blueprint to building it. → construction that follows the blueprint automatically
Immutable infrastructure
Not patching — building new and discarding the old. Removes the chance to hand-edit at all, which prevents drift.
Next story
Construction Follows the Blueprint, Automatically →
Want another term as a picture book? Request →