Skip to content

lambda/ttl-reaper: 'make deploy' defaults would DISARM the live production reaper and silently drop its DNS/alarm config #650

Closed

Description

@scttfrdmn

Found while redeploying the reaper for #645. The documented deploy command would have caused a production regression on the component that guards against runaway cost.

The hazard

lambda/ttl-reaper/Makefile declares defaults, and writes all 13 of them into .deploy-params.yaml on every make deploy — so each one is asserted, not left alone:

parameter Makefile default live production value
DRY_RUN true false — the reaper is ARMED
DNS_SWEEP false true
DNS_ZONE_ID (empty) Z0341053304H0DQXF6U4X
DNS_DOMAIN (empty) spore.host
ALARM_TOPIC_ARN (empty) arn:aws:sns:us-east-1:966362334030:spawn-sweep-alerts
ACCOUNTS_TABLE_KEY_ARN (empty) arn:aws:kms:us-east-1:966362334030:key/48eefc31-…

So a plain make deploy — the command in DEPLOYMENT.md — would:

  1. Disarm the production reaper (DryRun: false → true). Everything keeps running and reporting; it just stops terminating anything. That is the worst possible failure mode for a cost backstop: silent, and invisible until an instance outlives its TTL.
  2. Turn off DNS sweep and blank the hosted-zone/domain, disabling DNS records leak when spored doesn't exit through Cleanup (abrupt terminate/spot/crash) — no backstop reaper #438.
  3. Detach the alarm topic, so the failure alarms this stack creates fire into nothing — including fix(ttl-reaper): add alarm for the reaper not being invoked at all #504's new not-invoked alarm, which exists precisely to catch a reaper that stopped running.

The irony is that the Makefile's own comment block (lines 18-23) explains the opposite risk very carefully — that an omitted parameter becomes UsePreviousValue and is therefore unreachable, which is why #438 could not be enabled from make deploy. The fix for that was to pass every parameter explicitly. That solved unreachability and created this: now every parameter is overwritten with a default that does not match production.

Not hypothetical

The stack had not been updated since 2026-07-31. Anyone redeploying it today — to pick up #504's alarm, #625's fsx:/ssm: grants, or #645's packaging fix — would reach for make deploy.

I avoided it only by reading the live stack first and generating a complete 16-parameter override file from describe-stacks output, then diffing all 16 afterwards to prove zero drift. That should not be the thing standing between a routine redeploy and a disarmed reaper.

Note the Makefile passes 13 of the template's 16 parameters; MaxAge, Regions and Schedule are omitted and so do rely on UsePreviousValue. Regions matters — its template default is a fixed 11-region list, and if that ever diverged from what is deployed, a fallback would silently change reaper coverage.

Suggested shapes

  1. Read-then-write. Have deploy fetch current stack parameters and use them as the defaults, so an unspecified value means "keep what is deployed" rather than "reset to the Makefile's idea of default". Preserves the DNS records leak when spored doesn't exit through Cleanup (abrupt terminate/spot/crash) — no backstop reaper #438 fix (anything you do pass still gets through) while making the dangerous direction impossible.
  2. Refuse to change the dangerous ones implicitly. Require DRY_RUN to be passed explicitly for an existing stack; abort with a diff if an unspecified parameter would change. Cheap, and it turns a silent regression into a prompt.
  3. At minimum, print the before/after diff and require confirmation — the Makefile already echoes the mode-setting parameters, but it echoes what it is about to send, not what that changes.

(1) seems right: the information is one describe-stacks away, and it is what I did by hand.

Worth checking elsewhere

lambda/autoscale-orchestrator and lambda/pipeline-orchestrator use the same sam deploy --parameter-overrides pattern with Makefile-side defaults. I have not audited whether their defaults match what is deployed.

Activity

  1. added 6 commits that reference this issue on Oct 4, 2026
    00f9b04
    a9b7111
    6fd2ef8
    8695ba4
    c4d2b25
    37a29d1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions