Skip to content
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

Closed
1 of 2 tasks
lsmarsden opened this issue Jun 22, 2023 · 2 comments
Closed
1 of 2 tasks

aws-sqs: add Queue.addDeadLetterQueue(dlq) for imported Queues #26084

lsmarsden opened this issue Jun 22, 2023 · 2 comments
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.

Comments

@lsmarsden
Copy link

lsmarsden commented Jun 22, 2023

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 the Queue.Builder or passing QueueProps 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 an addDeadLetterQueue(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

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.84.0

Environment details (OS name and version, etc.)

MacOS Ventura 13

@lsmarsden lsmarsden added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jun 22, 2023
@github-actions github-actions bot added the @aws-cdk/aws-sqs Related to Amazon Simple Queue Service label Jun 22, 2023
@pahud pahud self-assigned this Jun 22, 2023
@pahud
Copy link
Contributor

pahud commented Jun 22, 2023

Queue.fromQueueArn() essentially import an existing Queue and CDK creates a reference for that and will not be able to modify or update it.

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.

@pahud pahud added p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jun 22, 2023
@pahud pahud removed their assignment Jun 22, 2023
@pahud pahud changed the title aws-sqs: add Queue.addDeadLetterQueue(dlq) aws-sqs: add Queue.addDeadLetterQueue(dlq) for imported Queues Jun 22, 2023
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

3 participants