Setting up a dead-letter queue with CDK takes three lines: deadLetterQueue: { queue, maxReceiveCount } , done. The real work starts afterwards. Who notices when the DLQ fills up? What happens to a message that will never work? And who moves the others back once the billing API is running again after an hour-long outage? In many projects the honest answer is: somebody, at some point, by hand.
In my first article on the SQS dead-letter queue I built this with the Serverless Framework: queue, DLQ, alarm and a redrive script. Today we go one step further. You wrap everything in a reusable AWS CDK construct, separate transient from permanent errors and let the DLQ move back automatically on a schedule. To keep this from turning into an endless loop, the most important ingredient comes before the schedule: clean error classification in the consumer.
In short
A custom CDK construct bundles queue, DLQ, alarms and a scheduled redrive via EventBridge Scheduler, so every new queue gets the same safety nets.…