Skip to content

feat(obs): assert the alarm path terminates at a confirmed subscriber - #1110

Merged
athvin merged 2 commits into
mainfrom
fix/alert-path-check
Nov 17, 2026
Merged

athvin merged 2 commits into
mainfrom
fix/alert-path-check

Conversation

@athvin

@athvin athvin commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Closes #1109

The detector for the #1107 incident: 19 armed CloudWatch alarms publishing to a
topic whose only subscriber had never confirmed, so nothing was delivered for
over a week — and nothing noticed.

This does not resolve #1107. That needs one click from the owner of the
subscribed address, and a detector does not deliver an alarm. It stays open.

Why no existing gate saw it

The declaration was correct the whole time. aws_sns_topic_subscription is in
envs/core/alerts.tf, terraform apply creates it happily, and an unconfirmed
subscription is indistinguishable from a working one in the console. SNS
requires the address to confirm and Terraform cannot.

drift does eventually notice, and that is the problem rather than the answer:
it notices on the wrong side of a three-day delay and for the wrong reason. AWS
deletes a subscription that stays pending, the refresh-only plan then reports
the resource gone, and tf-drift-classify.sh calls it real drift — days after
delivery stopped. It then self-heals destructively: the next apply re-creates
the subscription, pending again, so the cycle repeats forever and the alarms
never deliver. That is exactly what happened between 11-09 and today.

What it asserts

AWS returns the literal string PendingConfirmation in the SubscriptionArn
field for an unconfirmed subscription — it has no ARN yet. That string is the
whole test.

state verdict
at least one confirmed subscriber pass
confirmed + another pending pass, and says so
subscriptions exist, none confirmed fail
no subscriptions at all fail
Subscriptions key absent or not an array usage error (2)

The last two rows are the ones worth arguing about. Confirmed-plus-pending
passes deliberately: the path already terminates at a human, and failing the
schedule because someone added a second destination is the alarm fatigue this
is meant to prevent. And an absent Subscriptions key is a usage error
rather than a verdict — conflating it with an empty one means a renamed AWS
field would report "THE ALARM PATH IS DEAD" and send someone chasing an
incident that does not exist. My first draft had exactly that bug; the
self-test now pins both halves.

Endpoints are redacted (d***@gmail.com) in the same spirit as the drift
scripts never printing attribute values — this runs in a public repository's
logs.

Verification

Observed failing against the live account before being trusted, which is
the house rule:

$ aws sns list-subscriptions-by-topic --topic-arn …:er-alerts > subs.json
$ bash scripts/ci/alert-path-check.sh subs.json
alert-path-check: THE ALARM PATH IS DEAD — 1 subscription(s), none confirmed:
  email d***@gmail.com — never confirmed
alert-path-check: an SNS email subscription is confirmed by the ADDRESS, not by
alert-path-check: Terraform. Open the "AWS Notification - Subscription Confirmation"
alert-path-check: message and click Confirm subscription. See #1107.
LIVE_EXIT=1

alert-path-check-test: 13 passed, 0 failed. The self-test runs before the
check in the job, as the other detectors do — this one guards a path that was
already silently dead for a week, so a check that has stopped being able to
fail is worse than no check, because it reads as cover.

workflow-shell-check and scripts-home-check both pass; the two new run:
blocks are one line each with no control flow.

Post-merge ledger

Closed by: agent · session f14bf995-5565-41eb-9658-d3746dc3188e on Mac · 2026-11-17T07:45:00Z

Specific to this change

  • the new job was observed RED on a real run, not just locally —
    dispatch 44032499223. Its log reads:
    alert-path-check-test: 13 passed, 0 failed then
    alert-path-check: THE ALARM PATH IS DEAD — 1 subscription(s), none confirmed.
    drift never runs on a pull request, so this PR's own green said nothing
    about it.
  • the er-ci-tf-drift role could actually read SNS — exercised rather
    than inferred from the policy document. The CI run produced the verdict
    above with no AccessDenied, so ReadOnlyAccess does cover
    sns:ListSubscriptionsByTopic.
  • the endpoint is redacted in a public log — the CI output reads
    email d***@gmail.com — never confirmed. Worth checking in CI
    specifically rather than locally, because this repository's Actions logs
    are world-readable.
  • it goes GREEN once The er-alerts SNS email subscription has never been confirmed — 19 armed alarms reach nobody #1107 is confirmed — deferred — The er-alerts SNS email subscription has never been confirmed — 19 armed alarms reach nobody #1107. This is
    the one assertion that cannot be made yet: until someone clicks the
    confirmation link there is no confirmed subscriber, so the check correctly
    cannot pass. Until then it is red for a true reason, which is the whole
    point, but it does mean the passing path is proved only by the self-test's
    a confirmed subscriber passes case and not yet against the live account.

19 CloudWatch alarms publish to er-alerts, whose only subscription had never
been confirmed — nothing was delivered for over a week and nothing noticed.

No existing gate could see it. The declaration was correct: terraform creates
the subscription happily, but SNS requires the ADDRESS to confirm and an
unconfirmed subscription looks identical to a working one in the console. drift
does eventually notice, three days late and for the wrong reason — AWS expires
the pending subscription, the refresh reports it gone, and the next apply
re-creates it pending, so it cycles while the alarms stay silent.

AWS returns the literal string PendingConfirmation in SubscriptionArn for an
unconfirmed subscription; that is the whole test. Fails on zero subscriptions
and on zero confirmed ones; passes with a confirmed subscriber even if another
is pending, so adding a second destination does not redden the schedule.

An ABSENT Subscriptions key is a usage error, not a verdict — otherwise a
renamed AWS field would report the alarm path dead and send someone chasing an
incident that does not exist. Endpoints are redacted; this runs in a public
repository's logs.

Observed failing against the live account before being trusted: exit 1,
"THE ALARM PATH IS DEAD — 1 subscription(s), none confirmed". Self-test
13 passed, 0 failed.

Closes #1109
required-checks.md enumerates every workflow's jobs and their status-check
contexts, and is byte-compared by the agent-skill gate. Adding the alert-path
job to drift.yml moves it, so this is the regenerated row — the same class of
failure as a dependency version quoted in a generated reference, and the reason
both 'agent skills' and 'fmt + clippy + docs' went red: they run the same
staleness step.
@athvin
athvin merged commit 9f905b1 into main Nov 17, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants