Skip to content

Commit 2bc3f2b

Browse files
authored
VED-971 Fix mesh processor terraform (#1085)
1 parent 80e2774 commit 2bc3f2b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

infrastructure/instance/mesh_processor.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,11 @@ resource "aws_cloudwatch_log_group" "mesh_file_converter_log_group" {
260260
}
261261

262262
resource "aws_cloudwatch_log_metric_filter" "mesh_processor_error_logs" {
263-
count = var.error_alarm_notifications_enabled ? 1 : 0
263+
count = var.create_mesh_processor && var.error_alarm_notifications_enabled ? 1 : 0
264264

265265
name = "${local.short_prefix}-MeshProcessorErrorLogsFilter"
266266
pattern = "%\\[ERROR\\]%"
267-
log_group_name = aws_cloudwatch_log_group.mesh_file_converter_log_group[count.index].name
267+
log_group_name = aws_cloudwatch_log_group.mesh_file_converter_log_group[0].name
268268

269269
metric_transformation {
270270
name = "${local.short_prefix}-MeshProcessorErrorLogs"
@@ -274,7 +274,7 @@ resource "aws_cloudwatch_log_metric_filter" "mesh_processor_error_logs" {
274274
}
275275

276276
resource "aws_cloudwatch_metric_alarm" "mesh_processor_error_alarm" {
277-
count = var.error_alarm_notifications_enabled ? 1 : 0
277+
count = var.create_mesh_processor && var.error_alarm_notifications_enabled ? 1 : 0
278278

279279
alarm_name = "${local.short_prefix}-mesh-processor-lambda-error"
280280
comparison_operator = "GreaterThanOrEqualToThreshold"
@@ -287,4 +287,4 @@ resource "aws_cloudwatch_metric_alarm" "mesh_processor_error_alarm" {
287287
alarm_description = "This sets off an alarm for any error logs found in the mesh processor Lambda function"
288288
alarm_actions = [data.aws_sns_topic.imms_system_alert_errors.arn]
289289
treat_missing_data = "notBreaching"
290-
}
290+
}

0 commit comments

Comments
 (0)