New to Kestra?
Use blueprints to kickstart your first workflows.
Monitor Amazon SNS subscriber notification delivery and DLQ failures with Kestra. Query CloudWatch, open GitHub issues, and alert Slack.
Amazon Simple Notification Service (SNS) acts as a high-throughput fan-out messaging hub, pushing events to SQS queues, HTTP/HTTPS webhooks, AWS Lambda functions, and SMS endpoints. When subscriber endpoints fail authentication, time out, or throw 5xx server errors, SNS retries delivery according to its backoff policy before routing poison messages to dead-letter queues (DLQs) or dropping them completely. This blueprint queries Amazon CloudWatch for NumberOfNotificationsFailed on target topics periodically, identifies delivery drops, logs an automated GitHub incident issue, and alerts cloud operations teams via Slack.
periodic_sns_dlq_check (io.kestra.plugin.core.trigger.Schedule) initiates the audit every 15 minutes (shipped disabled for safe verification).probe_sns_delivery_metrics (io.kestra.plugin.aws.cli.AwsCLI) queries CloudWatch for NumberOfNotificationsFailed across the previous 15-minute window.evaluate_failed_notifications (io.kestra.plugin.core.debug.Return) evaluates whether any failed deliveries occurred (has_failures == true).branch_on_sns_failures (io.kestra.plugin.core.flow.If) evaluates the condition:then: Automatically files a GitHub tracking issue via create_sns_incident_issue (io.kestra.plugin.github.issues.Create) and alerts the Slack channel via alert_cloud_slack (io.kestra.plugin.slack.notifications.SlackIncomingWebhook).else: Emits an informational log entry (log_sns_healthy) confirming 100% delivery success.log_audit_complete (io.kestra.plugin.core.log.Log) records the final health summary.errors block alerts Slack if AWS API calls time out or credentials expire.Kestra simplifies cloud infrastructure reliability by unifying AWS CLI querying, JSON data extraction, conditional escalation, and chat alerting into a single declarative pipeline. It injects IAM credentials securely, provides complete execution history, and eliminates the need for separate standalone monitoring daemons.
cloudwatch:GetMetricData permissions.AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY: Credentials with CloudWatch read permissions.GITHUB_TOKEN: GitHub token used to open incident issues.SLACK_WEBHOOK: Incoming Webhook URL for cloud alerts.aws_region (STRING, default us-east-1): Target AWS region hosting the SNS topic.topic_name (STRING, default production-security-alerts): Name of the audited SNS topic.target_repository (STRING, default my-org/cloud-operations): Target GitHub repository for logging incident issues.outputs.probe_sns_delivery_metrics.vars.MetricDataResults: Raw CloudWatch metric data points.outputs.evaluate_failed_notifications.value.failed_count: Number of failed notifications detected.outputs.evaluate_failed_notifications.value.has_failures: Boolean indicating whether failures occurred.AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, GITHUB_TOKEN, and SLACK_WEBHOOK in your Kestra namespace.topic_name to match an active SNS topic.periodic_sns_dlq_check trigger for continuous notification delivery monitoring.aws sns list-subscriptions-by-topic) to identify the exact failing subscriber endpoint.ApproximateNumberOfMessagesVisible.