Skip to content

Commit 95b3c93

Browse files
committed
Add an alert for no executions in the past 4 hours
1 parent 5c67705 commit 95b3c93

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

terraform/modules/dirsync/main.tf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,22 @@ resource "aws_cloudwatch_metric_alarm" "invocation_error" {
112112
FunctionName = local.sync_lambda_name
113113
}
114114
}
115+
116+
resource "aws_cloudwatch_metric_alarm" "no_invocation" {
117+
alarm_name = "${local.sync_lambda_name}-no-invocation"
118+
alarm_description = "GSuite Directory Sync lambda has not executed in the past 4 hours."
119+
namespace = "AWS/Lambda"
120+
metric_name = "Invocations"
121+
statistic = "Sum"
122+
period = "14400"
123+
evaluation_periods = "1"
124+
comparison_operator = "LessThanThreshold"
125+
threshold = "1"
126+
treat_missing_data = "breaching"
127+
alarm_actions = [
128+
var.SnsArn
129+
]
130+
dimensions = {
131+
FunctionName = local.sync_lambda_name
132+
}
133+
}

0 commit comments

Comments
 (0)