forgejo/terraform/alarms.tf
Adam Moussa e4982b87ad
feat(terraform): migrate forgejo to HCP Terraform (PLAT-80) (#100)
* feat(terraform): migrate forgejo to HCP Terraform

Move the prod host onto workspace forgejo-prod in the After Hours VPC and freeze CDK push deploys so cutover can happen without applying into seahaven-prod.

* fix(terraform): restore forgejo.db from the dump tarball

Boot restore was copying data/ and repos/ and leaving the sqlite file at the archive root, so a volume restore started Forgejo with no database.
2026-09-29 22:49:21 +00:00

41 lines
1.3 KiB
HCL

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