[lambda] support for dead letter targets
See original GitHub issueAs 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:
- Created 4 years ago
- Reactions:2
- Comments:6 (5 by maintainers)
Top GitHub Comments
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
Closing this issue since there hasn’t been a response in a while. Feel free to reopen.