Skip to content

Instantly share code, notes, and snippets.

@ziedbentahar
Created April 17, 2023 07:30
...
const deadLetterQueue = new Queue(
this, "target-callback-deadletter-queue",
{ queueName: `${applicationName}-webhook-dlq` }
);
const webhookLambda = new NodejsFunction(
this,
`applicationName-callback-lambda`,
{
runtime: Runtime.NODEJS_18_X,
entry: resolve("../src/backend/lambdas/callback-lambda.ts"),
functionName: `${applicationName}-callback-lambda`,
handler: "handler",
}
);
new Rule(this, "target-callback-rule", {
eventBus: this.eventBus,
eventPattern: {
source: Match.prefix(""),
},
targets: [
new LambdaFunction(webhookLambda, {
retryAttempts: 10,
deadLetterQueue,
}),
],
});
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment