ADR-0035: Alarms also reach an issue, from the twice-daily health check#
- Status: accepted. Uses the plan role of ADR-0030 outside a plan.
- Date: 2026-11-27
Context#
Every CloudWatch alarm, the hourly DNSSEC probe's included, notifies one SNS topic, and the topic has one subscriber: an email address. If that mailbox filters the alerts or stops accepting them, nothing else hears. alarm-delivery-test shows delivery only when someone runs it.
The scheduled workflows already open issues, and their issues are watched. For an alarm to open one itself, AWS would need a GitHub credential: long-lived, and able to write to the repository.
Two scheduled workflows could carry a read of the alarms. drift-detection already holds the read-only plan role, but runs weekly. dns-health runs twice a day and keeps an incident issue, but holds no AWS role. The plan role trusts main with no environment, which a scheduled run of either carries, and its stack-read policy already grants cloudwatch:Describe*.
Decision#
dns-healthlists the alarms in ALARM with the plan role, in a job of its own that cannot write issues, and only in a run that owns the incident issue (the production domain, frommain). No permission and no trust policy changes.- One issue labelled
alarmstays open while any alarm is in ALARM. Its title and body say what the latest run found. It gets a comment only when the set of alarms changes, and is closed on the first run that finds none. The job that writes it runs no repository code. - Every alarm in ALARM counts, metric and composite. One that treats missing data as breaching is in ALARM when its metric stops, and the issue says so. The rehearsal zone's alarms count too, marked as concerning the child zone only: a rehearsal that breaks its chain of trust on purpose shows the path works, and one that breaks it by accident must be seen.
- A read that fails is never clear. A refused or unexplained read warns in the run summary and opens or updates the issue as alarm state unknown. The run fails while any alarm is in ALARM or its state is unknown.
scripts/alarm-verdict.pyjudges the read, against a stub AWS CLI inmake test-drift.tofu testasserts that the plan role can callcloudwatch:DescribeAlarms.
Alternatives considered#
drift-detection, which already holds the role. No new OIDC token in a workflow. But a weekly read leaves an alarm up to a week behind the mailbox, plus GitHub's lateness, and most alarms here come and go within a day. Twice a day is worth one more job that can mint a token for a read-only role.
A GitHub token in AWS, read by a Lambda subscribed to the topic. Punctual, and the long-lived, writing credential principle 4 rules out.
A second SNS subscriber, such as another address or a chat webhook. A second mailbox, or a third-party service that sees every alert, for a project with no contact address of its own.
Read the alarms' history, so an alarm that fires and clears between runs is reported too. It would open issues for every alarm-delivery-test run and every hourly probe that flapped once, and decide what each one meant. The state at the time of the run is the question the issue answers.
Fold the alarms into the health-check incident issue. One issue, but its closing rule (all checks passing) would close it over an alarm still in ALARM.
Consequences#
Positive: an alarm reaches someone without the mailbox, with no credential in AWS and no new permission. A broken read cannot pass as clear.
Negative: it is only as punctual as GitHub's schedule, which has started dns-health hours late; the email path stays the punctual one. An alarm that fires and clears between runs reaches only the mailbox, and so do the budget's notifications, which are not alarms. dns-health now holds an OIDC token, and the plan role's ADR-0030 scope (what a plan reads) is now also what this job may read. During a rehearsal, or while the probe is silent, dns-health runs are red, which is the point and is noise all the same.
Neutral: nothing is retired. The email path is the punctual one and alarm-delivery-test is the only proof of it; this is a job in an existing workflow and a test in an existing target.
Revisit when#
- The plan role is narrowed to exactly the reads a plan makes: this job then needs its own grant, or its own role.
- GitHub's schedule is late often enough that the issue arrives after the alarm has cleared.
- The project gains a contact address or a second maintainer, which would make a second subscriber worth its cost.