Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions infrastructure/modules/sqs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
| <a name="input_delay_seconds"></a> [delay\_seconds](#input\_delay\_seconds) | Time in seconds that the delivery of all messages in the queue will be delayed. An integer from 0 to 900 (15 minutes). | `number` | `0` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | The name of the tfscaffold environment | `string` | n/a | yes |
| <a name="input_fifo_queue"></a> [fifo\_queue](#input\_fifo\_queue) | Boolean designating a FIFO queue | `bool` | `false` | no |
| <a name="input_high_throughput_fifo"></a> [high\_throughput\_fifo](#input\_high\_throughput\_fifo) | For FIFO queues, specifies whether high throughput mode is enabled. | `bool` | `false` | no |
| <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 |
| <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 |
| <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 |
Expand Down
2 changes: 2 additions & 0 deletions infrastructure/modules/sqs/sqs_queue.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ resource "aws_sqs_queue" "sqs_queue" {
fifo_queue = var.fifo_queue
content_based_deduplication = var.content_based_deduplication
max_message_size = var.max_message_size
deduplication_scope = (var.fifo_queue && var.high_throughput_fifo) ? "messageGroup" : null
fifo_throughput_limit = (var.fifo_queue && var.high_throughput_fifo) ? "perMessageGroupId" : null

kms_master_key_id = var.sqs_kms_key_arn
kms_data_key_reuse_period_seconds = var.kms_data_key_reuse_period_seconds
Expand Down
12 changes: 12 additions & 0 deletions infrastructure/modules/sqs/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,15 @@ variable "create_dlq" {
type = bool
default = false
}

variable "high_throughput_fifo" {
description = "For FIFO queues, specifies whether high throughput mode is enabled."
type = bool
default = false

validation {
condition = var.high_throughput_fifo == false || var.fifo_queue == true
error_message = "high_throughput_fifo can only be true if fifo_queue is also true"
}
}

Loading