Bean & Bark: the bad Friday deploy
Friday, 4:44pm: revision 4 ships the new wholesale tier pricing. Friday, 4:52pm: Nadia's phone lights up — every order total on the storefront has doubled. The deploy itself was flawless; the code is wrong. This is the chapter the ledger has been preparing you for: the worst-day path, done calmly, in two commands — and the one thing a rollback will not fix for you.
- Read the ledger under pressure with
kanject aws deployments list - Roll a stage back with
rollback --to previous-stable— and know the four forms--toaccepts - Say exactly what a rollback changes on AWS (one thing) and what it never touches
- Mark a revision
brokenso no future rollback lands on it
Read the ledger first
Resist the urge to hotfix. First question on a bad deploy is never "what's wrong with the code?" — it's "what was the last version that worked?" The ledger has been answering that all week:
kanject aws deployments list --env dev --limit 5 Deployments stage dev ───────────────────────────────────────── Revision Target Deployed Commit Status By 4 Lambda 2026-07-11 16:44 d8e91f0 ✓ stable you@beanandbark 3 Lambda 2026-07-09 09:12 2b41c77 ✓ stable you@beanandbark 2 Lambda 2026-07-08 11:37 6c03aa1 ✓ stable you@beanandbark 1 Lambda 2026-07-07 09:26 9f3c1ab ✓ stable you@beanandbark There's the week in four rows: Monday's first deploy, Tuesday's config wiring, Wednesday's connection-string fix, and tonight's revision 4. Revision 3 ran clean for two days — that's the target.
Un-ship it
kanject aws rollback --env dev --to previous-stable --yes Before you run it — a guess. How long does this take? There's no build step in the answer: rollback doesn't rebuild anything. Every deployed revision is an immutable, already-published Lambda version sitting in AWS; a rollback just flips the live alias from version 4 to version 3. Seconds, not minutes — which is exactly what you want at 4:53pm on a Friday.
--to takes four forms: previous (one back), previous-stable (the newest revision not marked broken — the one to reach for by default), a commit-SHA prefix like 2b41c77, or a Lambda version number. In a script or CI it must be explicit — a non-interactive run refuses to guess. And the ledger stays honest: the rollback appends a new entry recording what happened (its By column carries a (rollback) suffix); revision 4 is not erased, because history that can be rewritten isn't history.
Leave a warning for your future self
Revision 4 still says ✓ stable in the ledger — and some future 4:52pm, someone running rollback --to previous-stable could land right back on it. Fix the record while the context is fresh:
kanject aws deployments mark 4 --status broken --env dev ✓ Marked revision 4 as broken. From now on previous-stable skips revision 4 forever. The status column is the institutional memory of which deploys betrayed you — two keystrokes now, one avoided incident later.
Rehearse it while nothing is on fire
The reason tonight took two commands and no adrenaline is that you've done it before. Make that true: after any healthy deploy to dev, spend sixty seconds flipping back and forward once. --dry-run works here too if you'd rather see the plan than run it.
# The 60-second drill — run it on dev while nothing is on firekanject aws rollback --env dev --to previous --yes # flip back one versionkanject aws rollback --env dev --to 4 --yes # flip forward again - Start every incident at the ledger:
deployments listshows what shipped, when, by whom, and what's still trusted. rollback --to previous-stableflips thelivealias to an already-published version — no rebuild, seconds to run — and appends a new ledger entry with a(rollback)suffix.- A rollback changes only the alias: database rows, migrations, S3 objects, and queue contracts stay as the bad deploy left them.
deployments mark <rev> --status brokenmakesprevious-stableskip that revision forever. Mark while the context is fresh.
broken, where does rollback --to previous-stable land?deployments list, flip forward again.--to can name the version you just left.Show solution
--to previous, list to watch the new (rollback) entry appear, then flip forward by version number. Total cost: two alias flips and two ledger entries. The day this is muscle memory is the day a real incident is boring.kanject aws rollback --env dev --to previous --yeskanject aws deployments list --env dev --limit 3kanject aws rollback --env dev --to 4 --yes