From 43ec5a4f3beb1d5ef79f090425a0ce0760d4f001 Mon Sep 17 00:00:00 2001 From: simonlabarere Date: Mon, 29 Jun 2026 11:04:00 +0100 Subject: [PATCH] CCM-19812: Fix eventpub queue names --- infrastructure/terraform/modules/eventpub/README.md | 1 - .../modules/eventpub/cloudwatch_metric_alarm_dlq_alarm.tf | 2 +- .../terraform/modules/eventpub/iam_role_lambda.tf | 2 +- .../terraform/modules/eventpub/lambda_function.tf | 2 +- .../terraform/modules/eventpub/module_sqs_queue.tf | 2 +- infrastructure/terraform/modules/eventpub/outputs.tf | 8 -------- .../terraform/modules/eventpub/sqs_queue_dlq.tf | 7 ------- 7 files changed, 4 insertions(+), 20 deletions(-) delete mode 100644 infrastructure/terraform/modules/eventpub/sqs_queue_dlq.tf diff --git a/infrastructure/terraform/modules/eventpub/README.md b/infrastructure/terraform/modules/eventpub/README.md index f013f131..c91733ea 100644 --- a/infrastructure/terraform/modules/eventpub/README.md +++ b/infrastructure/terraform/modules/eventpub/README.md @@ -46,7 +46,6 @@ | Name | Description | |------|-------------| -| [dlq](#output\_dlq) | EventPub DLQ name and ARN | | [publishing\_anomaly\_alarm](#output\_publishing\_anomaly\_alarm) | CloudWatch anomaly detection alarm details for SNS publishing | | [s3\_bucket\_event\_cache](#output\_s3\_bucket\_event\_cache) | S3 Bucket ARN and Name for event cache | | [sns\_topic](#output\_sns\_topic) | SNS Topic ARN and Name | diff --git a/infrastructure/terraform/modules/eventpub/cloudwatch_metric_alarm_dlq_alarm.tf b/infrastructure/terraform/modules/eventpub/cloudwatch_metric_alarm_dlq_alarm.tf index eae6bc47..77237d2d 100644 --- a/infrastructure/terraform/modules/eventpub/cloudwatch_metric_alarm_dlq_alarm.tf +++ b/infrastructure/terraform/modules/eventpub/cloudwatch_metric_alarm_dlq_alarm.tf @@ -12,6 +12,6 @@ resource "aws_cloudwatch_metric_alarm" "dlq_alarm" { treat_missing_data = "notBreaching" dimensions = { - QueueName = aws_sqs_queue.dlq.name + QueueName = module.sqs_queue.sqs_dlq_name } } diff --git a/infrastructure/terraform/modules/eventpub/iam_role_lambda.tf b/infrastructure/terraform/modules/eventpub/iam_role_lambda.tf index c6d5d5f8..76c439c4 100644 --- a/infrastructure/terraform/modules/eventpub/iam_role_lambda.tf +++ b/infrastructure/terraform/modules/eventpub/iam_role_lambda.tf @@ -77,7 +77,7 @@ data "aws_iam_policy_document" "lambda" { ] resources = [ - aws_sqs_queue.dlq.arn + module.sqs_queue.sqs_dlq_arn ] } diff --git a/infrastructure/terraform/modules/eventpub/lambda_function.tf b/infrastructure/terraform/modules/eventpub/lambda_function.tf index f5f9f618..76ee69f1 100644 --- a/infrastructure/terraform/modules/eventpub/lambda_function.tf +++ b/infrastructure/terraform/modules/eventpub/lambda_function.tf @@ -23,7 +23,7 @@ resource "aws_lambda_function" "main" { variables = { DATA_PLANE_EVENT_BUS_ARN = var.data_plane_bus_arn CONTROL_PLANE_EVENT_BUS_ARN = var.control_plane_bus_arn - DLQ_URL = aws_sqs_queue.dlq.url + DLQ_URL = module.sqs_queue.sqs_dlq_url THROTTLE_DELAY_MS = "0" } } diff --git a/infrastructure/terraform/modules/eventpub/module_sqs_queue.tf b/infrastructure/terraform/modules/eventpub/module_sqs_queue.tf index 08f29457..b6c1bb5e 100644 --- a/infrastructure/terraform/modules/eventpub/module_sqs_queue.tf +++ b/infrastructure/terraform/modules/eventpub/module_sqs_queue.tf @@ -6,7 +6,7 @@ module "sqs_queue" { environment = var.environment project = var.project region = var.region - name = local.csi + name = var.name create_dlq = true sqs_kms_key_arn = var.kms_key_arn sqs_policy_overload = data.aws_iam_policy_document.allow_sns_send.json diff --git a/infrastructure/terraform/modules/eventpub/outputs.tf b/infrastructure/terraform/modules/eventpub/outputs.tf index 2787f33a..bca1f34f 100644 --- a/infrastructure/terraform/modules/eventpub/outputs.tf +++ b/infrastructure/terraform/modules/eventpub/outputs.tf @@ -6,14 +6,6 @@ output "sns_topic" { } } -output "dlq" { - description = "EventPub DLQ name and ARN" - value = { - arn = aws_sqs_queue.dlq.arn - name = aws_sqs_queue.dlq.name - } -} - output "sqs_queue" { description = "EventPub SQS queue name, ARN, and DLQ details" value = { diff --git a/infrastructure/terraform/modules/eventpub/sqs_queue_dlq.tf b/infrastructure/terraform/modules/eventpub/sqs_queue_dlq.tf deleted file mode 100644 index 9af9ddbd..00000000 --- a/infrastructure/terraform/modules/eventpub/sqs_queue_dlq.tf +++ /dev/null @@ -1,7 +0,0 @@ -resource "aws_sqs_queue" "dlq" { - name = "${local.csi}-dlq" - - kms_master_key_id = var.kms_key_arn - - message_retention_seconds = 1209600 -}