add better dlq

This commit is contained in:
xss 2022-03-06 10:31:04 +11:00
parent a1d304457f
commit aabd0333b5
2 changed files with 19 additions and 4 deletions

View File

@ -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
}

View File

@ -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" {