forked from ExpediaGroup/apiary-lifecycle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlambda-cloudwatch.tf
25 lines (23 loc) · 907 Bytes
/
lambda-cloudwatch.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
* Copyright (C) 2019-2020 Expedia, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
*/
resource "aws_cloudwatch_metric_alarm" "beekeeper_sqs_dlq" {
count = var.slack_lambda_enabled == 1 ? 1 : 0
alarm_name = "${local.queue_alias}-dlq-alarm"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = "1"
metric_name = "ApproximateNumberOfMessagesVisible"
namespace = "AWS/SQS"
period = "60"
statistic = "Sum"
threshold = "1"
alarm_description = "This alarm monitors the number of messages in the Beekeeper SQS dead letter queue."
alarm_actions = [aws_sns_topic.beekeeper_sqs_dlq[count.index].arn]
treat_missing_data = "notBreaching"
tags = var.beekeeper_tags
dimensions = {
QueueName = "${local.queue_alias}-dead-letter"
}
}