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

Possibility to setup SNS dead letter queue for Lambda Function? #4758

Closed
MaartenThoelen opened this issue Oct 30, 2019 · 5 comments
Closed
Assignees
Labels
@aws-cdk/aws-sns Related to Amazon Simple Notification Service in-progress This issue is being actively worked on. needs-triage This issue or PR still needs to be triaged.

Comments

@MaartenThoelen
Copy link

❓ Possibility to setup SNS dead letter queue for Lambda Function?

The Question

Is it possible to setup an SNS dead letter queue for a Lambda Function using the AWS CDK?
It looks like only SQS dead letter queues are supported.

Environment

  • CDK CLI Version: 1.15.0 (build bdbe3aa)
  • Module Version: ^1.15.0
  • OS: OSX Mojave
  • Language: TypeScript
@MaartenThoelen MaartenThoelen added the needs-triage This issue or PR still needs to be triaged. label Oct 30, 2019
@nmussy
Copy link
Contributor

nmussy commented Oct 30, 2019

Hey @MaartenThoelen,

I'm not sure I understand what you mean by SNS dead letter queue. Unlike SQS, SNS delivers its messages synchronously to its subscribers.

There is a feature to log the delivery status in SQS or to a Lambda, but it's currently not implemented in CloudFormation. You can track its progress on the roadmap: cloudformation-coverage-roadmap#66

@MaartenThoelen
Copy link
Author

Hi @nmussy ,

I am trying to replicate the same behavior as I did before with an AWS SAM template.
See the attachment below for a snippet from the original template.

Screen Shot 2019-10-30 at 13 05 11

@nmussy
Copy link
Contributor

nmussy commented Oct 30, 2019

Ah, I see, sorry. The CDK documentation only accepts an SQS queue, but the CloudFormation
AWS::Lambda::Function DeadLetterConfig property docs says:

The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.

I'll make a PR to fix this issue. In the meantime, you should be able to circumvent the issue using an escape hatch. Tell me if you need more info.

Just as an FIY, there's also a package for SAM if you want to keep using it, see aws-sam's CfnFunction.deadLetterQueue

@MaartenThoelen
Copy link
Author

Great!

Thanks for the info.

@nmussy
Copy link
Contributor

nmussy commented Oct 30, 2019

Duplicate of #2739

@SomayaB SomayaB added in-progress This issue is being actively worked on. @aws-cdk/aws-sns Related to Amazon Simple Notification Service labels Oct 30, 2019
@SomayaB SomayaB closed this as completed Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-sns Related to Amazon Simple Notification Service in-progress This issue is being actively worked on. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

4 participants