From 3419a29cf0bc0e6a0069cd96db4c482c4bb0d972 Mon Sep 17 00:00:00 2001 From: Ian Hodges Date: Wed, 14 Jan 2026 16:00:46 +0000 Subject: [PATCH 1/2] CCM-13476: allow configurable maxReceiveCount for queues --- infrastructure/modules/sqs/sqs_queue_redrive_policy.tf | 2 +- infrastructure/modules/sqs/variables.tf | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/infrastructure/modules/sqs/sqs_queue_redrive_policy.tf b/infrastructure/modules/sqs/sqs_queue_redrive_policy.tf index 1df9ed2..2169dcf 100644 --- a/infrastructure/modules/sqs/sqs_queue_redrive_policy.tf +++ b/infrastructure/modules/sqs/sqs_queue_redrive_policy.tf @@ -4,6 +4,6 @@ resource "aws_sqs_queue_redrive_policy" "redrive_policy" { queue_url = aws_sqs_queue.sqs_queue.url redrive_policy = jsonencode({ deadLetterTargetArn = aws_sqs_queue.deadletter_queue[0].arn - maxReceiveCount = 3 + maxReceiveCount = var.max_receive_count }) } diff --git a/infrastructure/modules/sqs/variables.tf b/infrastructure/modules/sqs/variables.tf index 18fe88a..236c939 100644 --- a/infrastructure/modules/sqs/variables.tf +++ b/infrastructure/modules/sqs/variables.tf @@ -116,3 +116,9 @@ variable "create_dlq" { type = bool default = false } + +variable "max_receive_count" { + description = "The maximum number of times a message can be received before being sent to the DLQ" + type = number + default = 3 +} \ No newline at end of file From 1ac1d893d918fae3d76113e6daf992c6e5cf1f60 Mon Sep 17 00:00:00 2001 From: Ian Hodges Date: Wed, 14 Jan 2026 16:04:44 +0000 Subject: [PATCH 2/2] CCM-13476: allow configurable maxReceiveCount for queues --- infrastructure/modules/sqs/README.md | 1 + infrastructure/modules/sqs/variables.tf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/infrastructure/modules/sqs/README.md b/infrastructure/modules/sqs/README.md index 66fdead..12a2f40 100644 --- a/infrastructure/modules/sqs/README.md +++ b/infrastructure/modules/sqs/README.md @@ -23,6 +23,7 @@ | [fifo\_queue](#input\_fifo\_queue) | Boolean designating a FIFO queue | `bool` | `false` | no | | [kms\_data\_key\_reuse\_period\_seconds](#input\_kms\_data\_key\_reuse\_period\_seconds) | The length of time, in seconds, for which Amazon SQS can reuse a data key to encrypt or decrypt messages before calling AWS KMS again. An integer representing seconds, between 60 seconds (1 minute) and 86,400 seconds (24 hours) | `number` | `300` | no | | [max\_message\_size](#input\_max\_message\_size) | The limit of how many bytes a message can contain before Amazon SQS rejects it. An integer from 1024 bytes (1 KiB) up to 262144 bytes (256 KiB) | `number` | `262144` | no | +| [max\_receive\_count](#input\_max\_receive\_count) | The maximum number of times a message can be received before being sent to the DLQ | `number` | `3` | no | | [message\_retention\_seconds](#input\_message\_retention\_seconds) | The number of seconds Amazon SQS retains a message. Integer representing seconds, from 60 (1 minute) to 1209600 (14 days) | `number` | `null` | no | | [name](#input\_name) | Name of the SQS Queue | `string` | n/a | yes | | [project](#input\_project) | The name of the tfscaffold project | `string` | n/a | yes | diff --git a/infrastructure/modules/sqs/variables.tf b/infrastructure/modules/sqs/variables.tf index 236c939..f7ca0f6 100644 --- a/infrastructure/modules/sqs/variables.tf +++ b/infrastructure/modules/sqs/variables.tf @@ -121,4 +121,4 @@ variable "max_receive_count" { description = "The maximum number of times a message can be received before being sent to the DLQ" type = number default = 3 -} \ No newline at end of file +}