aws-samples / aws-samples/sample-autonomous-cloud-coding-agents

feat(cdk): wire DLQ CloudWatch alarms to SNS topic for alerting

Offen
#228 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement infra-cdk observability
Vorherrschende Sprache
TypeScript
Sterne
143
Forks
46
Ø Merge
3 T. 10 Std.
Gemergte PRs (30 T.)
24

Beschreibung

## Context

PR #208 added CloudWatch alarms on `FanOutDlq` and `ApprovalMetricsPublisherDlq` (threshold: `ApproximateNumberOfMessagesVisible >= 1`, 5-min window). The alarms are exposed as `public readonly dlqAlarm` on each construct but are not yet wired to any notification channel — they fire silently in the CloudWatch console.

## Proposal

Create an SNS topic (or accept one as a construct prop) and add alarm actions so operators get notified (email, PagerDuty, Slack webhook, etc.) when poison-pill records land in a DLQ.

### Acceptance criteria

- [ ] An SNS topic is created (or injected via prop) for DLQ alarm notifications
- [ ] Both `FanOutConsumer.dlqAlarm` and `ApprovalMetricsPublisherConsumer.dlqAlarm` have an alarm action targeting the topic
- [ ] Optional: OK action to notify when the alarm returns to normal
- [ ] Unit tests verify the alarm action is wired to the SNS topic ARN
- [ ] `cdk synth` produces the expected `AWS::CloudWatch::Alarm` → `AWS::SNS::Topic` relationship

### Design considerations

- Should the topic be shared across all DLQ alarms or per-construct? A single shared `OperationalAlarmsTopic` is simpler and matches the common pattern.
- Subscription management (email endpoints, chatbot integrations) can be handled out-of-band or via a `notificationEndpoints` stack parameter.

## References

- #117 (original DLQ alarm request)
- PR #208 (alarm implementation without SNS)

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit dem Lesen von PR #208 und den Definitionen von FanOutConsumer und ApprovalMetricsPublisherConsumer, wobei du dich auf ihre öffentlichen dlqAlarm-Eigenschaften konzentrierst. Entscheide, ob das SNS-Thema für Benachrichtigungen gemeinsam genutzt oder injiziert wird, und untersuche anschließend die vorhandenen Muster für Unit-Tests und die CDK-Synthese. Als erledigt gilt die Aufgabe, wenn beide Alarme SNS-Aktionen haben, Tests die Topic-ARN verifizieren und cdk synth die erwartete Beziehung zwischen Alarm und Topic zeigt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
aws, typescript
Bereich
cloud, infrastructure
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.