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

feat(events-targets): Add DLQ support for SNS target #19741

Closed
2 tasks
holomekc opened this issue Apr 3, 2022 · 2 comments · Fixed by #20062
Closed
2 tasks

feat(events-targets): Add DLQ support for SNS target #19741

holomekc opened this issue Apr 3, 2022 · 2 comments · Fixed by #20062
Assignees
Labels
@aws-cdk/aws-events-targets @aws-cdk/aws-sqs Related to Amazon Simple Queue Service effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2

Comments

@holomekc
Copy link

holomekc commented Apr 3, 2022

Describe the feature

For AWS event target SNS Topics can be used and at least in AWS UI it is possible to define a dead letter queue. Sadly this is not possible with CDK. Other Targets like SQS or EventBus does support it already. Check #16417.

Use Case

In case something does not work in event handling a dlq comes in handy, to see why event could not be handled.

Proposed Solution

import * as sns from "@aws-cdk/aws-sns";
import * as sqs from "@aws-cdk/aws-sqs";
import * as events from "@aws-cdk/aws-events";
import * as targets from "@aws-cdk/aws-events-targets";

const targetSQS = new sns.Topic(this, 'targetSNS', {
  topicName: 'targetSNS',
});

const rule = new events.Rule(this, 'rule', {
  eventPattern: {
    source: ["aws.ec2"],
  },
});

const myDeadLetterQueue = new sqs.Queue(this, 'myDeadLetterQueue');

rule.addTarget(new targets.SnsTopic(targetSNS, {
  deadLetterQueue: myDeadLetterQueue
}));

Other Information

No response

Acknowledgements

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

CDK version used

1.150.0

Environment details (OS name and version, etc.)

OSX 12.1

@holomekc holomekc added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Apr 3, 2022
@github-actions github-actions bot added the @aws-cdk/aws-sqs Related to Amazon Simple Queue Service label Apr 3, 2022
@holomekc holomekc changed the title (short issue description) feat(events-targets): Add DLQ support for SNS target Apr 3, 2022
@rix0rrr rix0rrr added effort/small Small work item – less than a day of effort p2 and removed needs-triage This issue or PR still needs to be triaged. labels Apr 7, 2022
@rix0rrr rix0rrr removed their assignment Apr 7, 2022
@rix0rrr
Copy link
Contributor

rix0rrr commented Apr 7, 2022

A PR to add this is welcome

@mergify mergify bot closed this as completed in #20062 Jun 14, 2022
mergify bot pushed a commit that referenced this issue Jun 14, 2022
Add DLQ support for SNS target.

Closes #19741.

----

### All Submissions:

* [X] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [X] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)?
	* [X] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@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.

daschaa pushed a commit to daschaa/aws-cdk that referenced this issue Jul 9, 2022
Add DLQ support for SNS target.

Closes aws#19741.

----

### All Submissions:

* [X] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [X] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)?
	* [X] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-events-targets @aws-cdk/aws-sqs Related to Amazon Simple Queue Service effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants