mirror of
https://github.com/Sea-Haven-Industries/forgejo.git
synced 2026-09-30 04:13:11 +00:00
42 lines
1.3 KiB
Terraform
42 lines
1.3 KiB
Terraform
|
|
resource "aws_cloudwatch_metric_alarm" "verification_errors" {
|
||
|
|
count = var.enable_schedules ? 1 : 0
|
||
|
|
|
||
|
|
alarm_name = "forgejo-backup-verification-errors"
|
||
|
|
alarm_description = "Backup verification Lambda is failing. Slack notifications may not be firing."
|
||
|
|
comparison_operator = "GreaterThanOrEqualToThreshold"
|
||
|
|
evaluation_periods = 1
|
||
|
|
metric_name = "Errors"
|
||
|
|
namespace = "AWS/Lambda"
|
||
|
|
period = 3600
|
||
|
|
statistic = "Sum"
|
||
|
|
threshold = 1
|
||
|
|
treat_missing_data = "notBreaching"
|
||
|
|
|
||
|
|
dimensions = {
|
||
|
|
FunctionName = aws_lambda_function.verification.function_name
|
||
|
|
}
|
||
|
|
|
||
|
|
alarm_actions = [local.site_alerts_arn]
|
||
|
|
}
|
||
|
|
|
||
|
|
resource "aws_cloudwatch_metric_alarm" "verification_not_running" {
|
||
|
|
count = var.enable_schedules ? 1 : 0
|
||
|
|
|
||
|
|
alarm_name = "forgejo-backup-verification-not-running"
|
||
|
|
alarm_description = "Backup verification Lambda has not run in the last 24h."
|
||
|
|
comparison_operator = "LessThanThreshold"
|
||
|
|
evaluation_periods = 1
|
||
|
|
metric_name = "Invocations"
|
||
|
|
namespace = "AWS/Lambda"
|
||
|
|
period = 86400
|
||
|
|
statistic = "Sum"
|
||
|
|
threshold = 1
|
||
|
|
treat_missing_data = "breaching"
|
||
|
|
|
||
|
|
dimensions = {
|
||
|
|
FunctionName = aws_lambda_function.verification.function_name
|
||
|
|
}
|
||
|
|
|
||
|
|
alarm_actions = [local.site_alerts_arn]
|
||
|
|
}
|