From e7ecdff2e8fee889c4b702b7bf0764b6c12b05d1 Mon Sep 17 00:00:00 2001 From: jamesthompson26-nhs Date: Wed, 9 Apr 2025 10:34:03 +0100 Subject: [PATCH] CCM-8589: Event Publisher DLQ Alerting --- .../cloudwatch_metric_alarm_dlq_alarm.tf | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 infrastructure/modules/eventpub/cloudwatch_metric_alarm_dlq_alarm.tf diff --git a/infrastructure/modules/eventpub/cloudwatch_metric_alarm_dlq_alarm.tf b/infrastructure/modules/eventpub/cloudwatch_metric_alarm_dlq_alarm.tf new file mode 100644 index 0000000..4ba62ee --- /dev/null +++ b/infrastructure/modules/eventpub/cloudwatch_metric_alarm_dlq_alarm.tf @@ -0,0 +1,16 @@ +resource "aws_cloudwatch_metric_alarm" "dlq_alarm" { + alarm_name = "${local.csi}-dlq-messages-alarm" + alarm_description = "Alarm for messages in the DLQ" + comparison_operator = "GreaterThanThreshold" + evaluation_periods = 1 + metric_name = "ApproximateNumberOfMessagesVisible" + namespace = "AWS/SQS" + period = 300 + statistic = "Sum" + threshold = 0 + actions_enabled = true + + dimensions = { + QueueName = aws_sqs_queue.dlq.name + } +}