question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[lambda] support for dead letter targets

See original GitHub issue

As it was suggested to my colleague @pierreozoux in https://github.com/awslabs/aws-cdk/issues/660, we are now opening this issue, because we’d love to have support for SNS dead letters in the Function L2 construct.

Right now we are successfully working around this, by overriding the property on the internal L1 resource after the L2 resource has been instantiated:

protected addSnsDeadLetterConfig(topic: Topic): void {
    this.role.addToPolicy(DbcsLambda.createPolicyStatement(topic.topicArn, 'SNS:Publish'));

    (this.function.node.findChild('Resource') as CfnResource).addPropertyOverride('deadLetterConfig', {
        targetArn: topic.topicArn
    });
}

Nonetheless, it would be cool to have to have real support for this on Function. From reading all the comments in https://github.com/awslabs/aws-cdk/issues/660, I understand that you are going through some hassle with the dependencies between the Lambda and SNS packages.

Would it maybe be feasible to have a very simple approach for starters so that the FunctionProps have a field deadLetterTargetArn that is used if the deadLetterQueueEnabled flag is false?

This way, the Lambda package does not necessarily need to care about the SNS package in the beginning and later one can develop a similar high-level approach for SNS as it already exists for SQS.

I’d also be totally open to contribute code to this, if we find an approach for this problem.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
nmussycommented, Oct 30, 2019

Hey everyone, sorry I didn’t see this issue earlier, this was a pretty low-hanging fruit. A duplicate was just opened recently, #4758. I’ve opened a PR to close both.

@SomayaB You might want to change the package tag to package/lambda

0reactions
SomayaBcommented, Feb 21, 2020

Closing this issue since there hasn’t been a response in a while. Feel free to reopen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS Lambda Supports Dead Letter Queues
You can provide an SQS queue or an SNS topic as the 'TargetArn' for your DLQ, and AWS Lambda will write the event...
Read more >
Enable Dead Letter Queue for Lambda Functions - Trend Micro
Configuring Dead Letter Queues for Amazon Lambda functions will give you more control over message handling for all asynchronous invocations, including those ...
Read more >
Using SNS And SQS As Target For AWS Lambda Dead ...
This article covers the pros and cons of usage of SQS and SNS as Lambda Dead Letter Queue (DLQ) in AWS cloud.
Read more >
Serverless Plugin Lambda Dead Letter
At the time this plugin was developed AWS Cloudformation (and serverless) did not support the DeadLetterConfig property of the Lambda so we have...
Read more >
Using dead-letter queues in Amazon SQS
A dead letter queue is one that other (source) queues can target for messages ... SQS Dead Letter Queues in the Amazon Simple...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found