-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws-sqs: add Queue.addDeadLetterQueue(dlq) for imported Queues #26084
Comments
AFAIK, the DLQ is defined in RedrivePolicy prop of the Queue resource and CDK has no idea about the properties of the imported Queue resource. I am afraid this is probably not something the Queue L2 construct can control. In general, when we import existing resources with CDK, especially for those created manually or outsides of CDK, CDK literally create references to those resources and basically CDK or cloudformation just can't modify or update those resources at all because they are not managed by CDK or cloudformation at all. |
|
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: