Skip to content

Instantly share code, notes, and snippets.

@chrisguitarguy
Last active November 7, 2025 14:27
Show Gist options
  • Select an option

  • Save chrisguitarguy/13b51ed584984fb3d9e9586aaeb1766f to your computer and use it in GitHub Desktop.

Select an option

Save chrisguitarguy/13b51ed584984fb3d9e9586aaeb1766f to your computer and use it in GitHub Desktop.

Revisions

  1. chrisguitarguy renamed this gist Nov 7, 2025. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. chrisguitarguy created this gist Nov 7, 2025.
    24 changes: 24 additions & 0 deletions sqs.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    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
    })
    }