Skip to content

Commit 840b62b

Browse files
authored
Merge pull request #146 from NHSDigital/feature/CCM-13476_max-receive-count
CCM-13476 Allow configurable maxReceiveCount for queues
2 parents 63a9e72 + 1ac1d89 commit 840b62b

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

infrastructure/modules/sqs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
| <a name="input_fifo_queue"></a> [fifo\_queue](#input\_fifo\_queue) | Boolean designating a FIFO queue | `bool` | `false` | no |
2424
| <a name="input_kms_data_key_reuse_period_seconds"></a> [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 |
2525
| <a name="input_max_message_size"></a> [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 |
26+
| <a name="input_max_receive_count"></a> [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 |
2627
| <a name="input_message_retention_seconds"></a> [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 |
2728
| <a name="input_name"></a> [name](#input\_name) | Name of the SQS Queue | `string` | n/a | yes |
2829
| <a name="input_project"></a> [project](#input\_project) | The name of the tfscaffold project | `string` | n/a | yes |

infrastructure/modules/sqs/sqs_queue_redrive_policy.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ resource "aws_sqs_queue_redrive_policy" "redrive_policy" {
44
queue_url = aws_sqs_queue.sqs_queue.url
55
redrive_policy = jsonencode({
66
deadLetterTargetArn = aws_sqs_queue.deadletter_queue[0].arn
7-
maxReceiveCount = 3
7+
maxReceiveCount = var.max_receive_count
88
})
99
}

infrastructure/modules/sqs/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,9 @@ variable "create_dlq" {
116116
type = bool
117117
default = false
118118
}
119+
120+
variable "max_receive_count" {
121+
description = "The maximum number of times a message can be received before being sent to the DLQ"
122+
type = number
123+
default = 3
124+
}

0 commit comments

Comments
 (0)