diff --git a/historic.tf b/historic.tf index ccee621..f565623 100644 --- a/historic.tf +++ b/historic.tf @@ -108,8 +108,23 @@ resource "aws_lambda_function" "queue_data_update" { resource "aws_sqs_queue" "historic_to_s3" { name = "update-history" receive_wait_time_seconds = 0 - message_retention_seconds = 1209600 # 14 days - visibility_timeout_seconds = 300 + message_retention_seconds = 259200 + visibility_timeout_seconds = 3600 + + + redrive_policy = jsonencode( + { + deadLetterTargetArn = aws_sqs_queue.historic_to_s3_dlq.arn + maxReceiveCount = 100 + } + ) +} + +resource "aws_sqs_queue" "historic_to_s3_dlq" { + name = "update-history-dlq" + receive_wait_time_seconds = 1 + message_retention_seconds = 1209600 # 14 days + visibility_timeout_seconds = 10 } diff --git a/sqs_to_elk.tf b/sqs_to_elk.tf index 81598c8..3bdb9f8 100644 --- a/sqs_to_elk.tf +++ b/sqs_to_elk.tf @@ -97,10 +97,10 @@ resource "aws_sqs_queue" "sqs_to_elk" { redrive_policy = jsonencode( { deadLetterTargetArn = "arn:aws:sqs:us-east-1:143841941773:to-elk-dlq" - maxReceiveCount = 10 + maxReceiveCount = 100 } ) - visibility_timeout_seconds = 3600 + visibility_timeout_seconds = 10 } resource "aws_sqs_queue_policy" "sqs_to_elk" {