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 + } +}