Last active
November 7, 2025 14:27
-
-
Save chrisguitarguy/13b51ed584984fb3d9e9586aaeb1766f to your computer and use it in GitHub Desktop.
terraform sqs eample with dead letter queues
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resource "aws_sqs_queue" "example" { | |
| name = "example" | |
| } | |
| resource "aws_sqs_queue" "example-dlq" { | |
| name = "example-dlq" | |
| message_retention_seconds = 1209600 # 14 days | |
| } | |
| resource "aws_sqs_queue_redrive_allow_policy" "example-dlq" { | |
| queue_url = aws_sqs_queue.example-dlq.url | |
| redrive_allow_policy = jsonencode({ | |
| redrivePermission = "byQueue", | |
| sourceQueueArns = [aws_sqs_queue.example.arn], | |
| }) | |
| } | |
| resource "aws_sqs_queue_redrive_policy" "example" { | |
| queue_url = aws_sqs_queue.example.url | |
| redrive_policy = jsonencode({ | |
| deadLetterTargetArn = aws_sqs_queue.example-dlq.arn | |
| maxReceiveCount = 3 | |
| }) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment