aws-sqs: add Queue.addDeadLetterQueue(dlq) for imported Queues #26084
Labels
@aws-cdk/aws-sqs
Related to Amazon Simple Queue Service
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Describe the feature
At the moment, if an SQS queue is imported via
Queue.fromQueueArn()
, the resulting queue cannot have a DLQ added to it via the CDK. DLQs can only be attached at creation time in theQueue.Builder
or passingQueueProps
to the constructor.In a similar way to aws-lambda's
addEventSource(eventSource)
, it would be nice to be able to add a DLQ to an existing SQS queue after it has been created, e.g. via anaddDeadLetterQueue(dlq)
method.Use Case
I have a few SQS queues that have been created manually outside of my control. Unfortunately, there is no opportunity to delete these queues and recreate them directly in the CDK, so it has to be used as an import via
Queue.fromQueueArn()
. I'd like to set a DLQ on this queue via the CDK, and continue to use this queue in the rest of the CDK.It may also be useful to decide to add a DLQ later on after the initial creation of non-imported queues, as an alternative to
Queue.Builder.create(scope, id).deadLetterQueue(dlq).build();
Proposed Solution
No response
Other Information
No response
Acknowledgements
CDK version used
2.84.0
Environment details (OS name and version, etc.)
MacOS Ventura 13
The text was updated successfully, but these errors were encountered: