Skip to content

StartMessageMoveTask

Source: src/AWS/SQS/StartMessageMoveTask.ts

Runtime binding for sqs:StartMessageMoveTask (dead-letter queue redrive).

Bind this operation to a dead-letter Queue (the redrive source) inside a function runtime to start moving its messages. Redrive requires more than the start permission alone, so the binding grants the host function sqs:StartMessageMoveTask, sqs:ReceiveMessage, sqs:DeleteMessage, and sqs:GetQueueAttributes on the source queue.

Pass a destination Queue at bind time to redrive into a specific queue (grants sqs:SendMessage + sqs:GetQueueAttributes on it and injects its ARN as DestinationArn). Without a destination, messages are redriven to their original source queues — which requires sqs:SendMessage on those queues, so the binding grants sqs:SendMessage on * in that mode.

Provide the StartMessageMoveTaskHttp layer on the Function to implement the binding.

Redrive a DLQ into a Specific Queue

// init (provide SQS.StartMessageMoveTaskHttp on the Function)
const startMessageMoveTask = yield* SQS.StartMessageMoveTask(dlq, {
destination: ordersQueue,
});
// runtime
const { TaskHandle } = yield* startMessageMoveTask();

Rate-Limited Redrive

yield* startMessageMoveTask({ MaxNumberOfMessagesPerSecond: 10 });