Docs & Code Guide

Keep runbooks in sync with infrastructure: link steps to living sources

A runbook is the one document read under maximum stress by someone with minimum context, which makes staleness here more expensive than anywhere else in your docs. Runbooks rot in specific, concrete ways: the bastion host was renamed, the dashboard moved, the IAM role the steps assume no longer grants what it did. The fix is structural, not editorial: every step should reference a source that changes with the infrastructure, instead of a value copied from it.

7 min readFor on-call engineers who have followed a runbook into a dead end

See it as a diagram

Everything below, as a diagram you can edit. Describe yours and see it in seconds.

213/20003 credits left
Try:

No account needed · Editable canvas, not a picture

How infrastructure drift breaks a runbook

The failure modes are concrete. A hostname copied into step 3 stops resolving after a migration to new instances. A link to "the latency dashboard" 404s because someone reorganized Grafana folders and the URL embedded the title, not the UID. A step says to assume the ops-admin role, but a security review narrowed that role and the command now fails with an error the runbook never mentions. Each of these worked when written; the infrastructure moved and the copies did not.

The consequences compound at the exact wrong time. The engineer following the runbook is paged, unsure, possibly new to the service, and every dead end costs minutes of incident time and a piece of their trust in every other runbook. The organizational math of that risk is laid out in stale runbooks as incident risk.

Game days are the sync test

A runbook is only verified by execution. A game day, a scheduled exercise where an engineer follows the runbook against a real or staged failure, is to runbooks what CI is to code: the test that finds the renamed host before 3am does. Run one per critical runbook per quarter, have someone unfamiliar with the service drive, and treat every point where they stop and ask a human as a defect to fix in the document before the exercise ends.

Stamp the result. A last_verified date with a reference to the exercise, as in the snippet above, tells the next reader exactly how much to trust each step. A runbook verified last month reads differently from one verified never, and making that visible is most of the battle.

Ownership and the review cadence

Runbooks decay per service, so ownership must be per runbook, and the natural owner is the rotation that gets paged for it. The working agreement: whoever is on call when a runbook step fails fixes that step before the retro closes, and each runbook is re-verified on a stated cadence. What that cadence should be, and what to do when it slips, is the subject of a documentation SLA.

The system picture inside the runbook

Most runbooks open with an architecture sketch, and it is usually the stalest part of the page: a screenshot from the wiki, itself a screenshot of something older. Replace it with a live embed. A Datadef diagram shared public serves a permanent image URL that Confluence, Notion, or Markdown render like any image, and an edit to the diagram shows up in the runbook within minutes. When infrastructure changes merge, an AI agent connected to the Datadef MCP server can update the diagram from the repo as a CI step; nothing watches the repo by itself, the regeneration is one wired command.

The honest limits: the embed requires a public project, which may not fit infrastructure diagrams that are themselves sensitive, and Datadef updates the diagram, not the runbook prose. The steps, the commands, and the last_verified stamp remain human work with the mechanisms above.

The runbook test

Read each step and ask: if the infrastructure changed tomorrow, would this step change with it or lie? Commands that resolve values, UID permalinks, and live embeds change with it. Copied hostnames, titled links, and pasted screenshots lie.

FAQ

How do I keep runbooks up to date?

Structurally, not editorially. Replace every copied value with a reference that moves with the infrastructure: commands that resolve hostnames from Terraform outputs, dashboard links using stable UIDs instead of titles, IAM roles named from the IaC definitions. Then verify by execution with quarterly game days, stamp each runbook with an owner and a last-verified date, and fix any step that fails during a real incident before the retro closes.

What makes runbooks go out of date?

Infrastructure drift hitting copied values. Hosts get renamed or replaced and hard-coded hostnames stop resolving, dashboards move and title-based links 404, IAM roles get narrowed and documented commands start failing with permission errors. Each copied value in a runbook is a snapshot of infrastructure at writing time, and every subsequent change silently invalidates it.

What is a game day for runbooks?

A scheduled exercise where an engineer, ideally one unfamiliar with the service, executes a runbook against a real or simulated failure. Every step where they get stuck or ask a human is treated as a documentation defect and fixed immediately. It is the only reliable verification a runbook gets, and the completion date becomes the runbook's last-verified stamp.

Who should own a runbook?

The on-call rotation that gets paged for the service it covers, not a docs team. The owning rotation fixes any step that fails during an incident before the retrospective closes and re-verifies the runbook on a stated cadence. Ownership by the people who suffer the staleness is the only incentive structure that survives contact with sprint pressure.

How do I keep the architecture diagram in a runbook current?

Serve it from a live URL instead of pasting a screenshot. A Datadef diagram in a public project has a permanent image URL that renders in Confluence, Notion, and Markdown, and an edit to the diagram appears in the runbook within minutes. Updates to the diagram itself can be made by an AI agent connected to the Datadef MCP server as a CI step after infrastructure merges; the trigger is a wired command, not automatic repo watching.