Skip to content

Commit f3b9986

Browse files
committed
reworked to standard Q with DLQ
1 parent 7861231 commit f3b9986

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

terraform/sqs_id_sync.tf

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
1-
# FIFO SQS Queue
1+
# Standard SQS Queue
2+
23
resource "aws_sqs_queue" "id_sync_queue" {
3-
name = "${local.short_prefix}-id-sync-queue.fifo" # Must end with .fifo
4-
fifo_queue = true
5-
content_based_deduplication = true # Optional, helps with deduplication
4+
name = "${local.short_prefix}-id-sync-queue"
65
visibility_timeout_seconds = 60
6+
redrive_policy = jsonencode({
7+
deadLetterTargetArn = aws_sqs_queue.id_sync_dlq.arn
8+
maxReceiveCount = 4
9+
})}
10+
11+
# DLQ for id-sync-queue
12+
13+
resource "aws_sqs_queue" "id_sync_dlq" {
14+
name = "${local.short_prefix}-id-sync-dlq"
15+
}
16+
17+
resource "aws_sqs_queue_redrive_allow_policy" "id_sync_queue_redrive_allow_policy" {
18+
queue_url = aws_sqs_queue.id_sync_dlq.id
19+
20+
redrive_allow_policy = jsonencode({
21+
redrivePermission = "byQueue",
22+
sourceQueueArns = [aws_sqs_queue.id_sync_queue.arn]
23+
})
724
}

0 commit comments

Comments
 (0)