Learn how to configure a dead-letter queue redrive in Amazon SQS

From wikieduonline
Jump to navigation Jump to search

Official example[edit]

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "sqs:StartMessageMoveTask",
        "sqs:CancelMessageMoveTask",
        "sqs:ListMessageMoveTasks",
        "sqs:ReceiveMessage",
        "sqs:DeleteMessage",
        "sqs:GetQueueAttributes",
        "sqs:ListDeadLetterSourceQueues"
      ],
      "Resource": "arn:aws:sqs:<DLQ_region>:<DLQ_accountId>:<DLQ_name>",
      "Condition": {
        "StringEquals": {
          "aws:ResourceTag/QueueRole": "source"
        }
      }
    },
    {
      "Effect": "Allow",
      "Action": "sqs:SendMessage",
      "Resource": "arn:aws:sqs:<DestQueue_region>:<DestQueue_accountId>:<DestQueue_name>",
      "Condition": {
        "StringEquals": {
          "aws:ResourceTag/QueueRole": "destination"
        }
      }
    },
    {
      "Effect": "Allow",
      "Action": [
        "kms:Decrypt",
        "kms:GenerateDataKey"
      ],
      "Resource": [
        "arn:aws:kms:<region>:<accountId>:key/<SourceQueueKeyId>",
        "arn:aws:kms:<region>:<accountId>:key/<DestQueueKeyId>"
      ]
    }
  ]
}

Related[edit]

See also[edit]

Advertising: