File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,5 +3,8 @@ immunisation_account_id = "084828561157"
33dspp_core_account_id = " 603871901111"
44pds_environment = " int"
55error_alarm_notifications_enabled = true
6+
7+ # mesh no invocation period metric set to 3 days (in seconds) for preprod environment i.e 3 * 24 * 60 * 60
8+ mesh_no_invocation_period_seconds = 259200
69create_mesh_processor = true
710has_sub_environment_scope = false
Original file line number Diff line number Diff line change @@ -3,5 +3,8 @@ immunisation_account_id = "084828561157"
33dspp_core_account_id = " 603871901111"
44pds_environment = " int"
55error_alarm_notifications_enabled = true
6+
7+ # mesh no invocation period metric set to 3 days (in seconds) for preprod environment i.e 3 * 24 * 60 * 60
8+ mesh_no_invocation_period_seconds = 259200
69create_mesh_processor = true
710has_sub_environment_scope = false
Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ immunisation_account_id = "664418956997"
33dspp_core_account_id = " 232116723729"
44pds_environment = " prod"
55error_alarm_notifications_enabled = true
6+
7+ # mesh no invocation period metric set to 1 day (in seconds) for prod environment i.e 1 * 24 * 60 * 60
8+ mesh_no_invocation_period_seconds = 86400
69create_mesh_processor = true
710has_sub_environment_scope = false
811dspp_kms_key_alias = " nhsd-dspp-core-prod-extended-attributes-gdp-key"
Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ immunisation_account_id = "664418956997"
33dspp_core_account_id = " 232116723729"
44pds_environment = " prod"
55error_alarm_notifications_enabled = true
6+
7+ # mesh no invocation period metric set to 1 day (in seconds) for prod environment i.e 1 * 24 * 60 * 60
8+ mesh_no_invocation_period_seconds = 86400
69create_mesh_processor = true
710has_sub_environment_scope = false
811dspp_kms_key_alias = " nhsd-dspp-core-prod-extended-attributes-gdp-key"
Original file line number Diff line number Diff line change @@ -288,3 +288,25 @@ resource "aws_cloudwatch_metric_alarm" "mesh_processor_error_alarm" {
288288 alarm_actions = [data . aws_sns_topic . imms_system_alert_errors . arn ]
289289 treat_missing_data = " notBreaching"
290290}
291+
292+ resource "aws_cloudwatch_metric_alarm" "mesh_processor_no_lambda_invocation_alarm" {
293+ count = var. create_mesh_processor && var. error_alarm_notifications_enabled ? 1 : 0
294+
295+ alarm_name = " imms-${ local . resource_scope } -mesh-processor-no-lambda-invocation"
296+ alarm_description = " Triggers when the MESH Processor Lambda has no invocations for the configured time window."
297+
298+ metric_name = " Invocations"
299+ namespace = " AWS/Lambda"
300+ statistic = " Sum"
301+ period = var. mesh_no_invocation_period_seconds
302+
303+ evaluation_periods = 1
304+ comparison_operator = " LessThanThreshold"
305+ threshold = 1
306+ treat_missing_data = " breaching"
307+ dimensions = {
308+ FunctionName = aws_lambda_function.mesh_file_converter_lambda[0 ].function_name
309+ }
310+
311+ alarm_actions = [data . aws_sns_topic . imms_system_alert_errors . arn ]
312+ }
Original file line number Diff line number Diff line change @@ -40,6 +40,12 @@ variable "pds_environment" {
4040 default = " int"
4141}
4242
43+ variable "mesh_no_invocation_period_seconds" {
44+ description = " The maximum duration the MESH Processor Lambda can go without being invoked before the no-invocation alarm is triggered."
45+ type = number
46+ default = 300
47+ }
48+
4349# Remember to switch off in PR envs after testing
4450variable "error_alarm_notifications_enabled" {
4551 default = true
You can’t perform that action at this time.
0 commit comments