Need some help with creating a DQL for EvenBridge ...
# help
m
Need some help with creating a DQL for EvenBridge https://github.com/mfolivas/aws-node-eventbridge-serverless I tried it with serverless but I couldn't figure it out.
f
@Marcelo Olivas I just added an EventBus example on the migration guide. https://docs.serverless-stack.com/migrating-from-serverless-framework#eventbus-event
Does that answer your question?
m
I need a DLQ for the events @Frank
f
U mean a DLQ for the Lambda that’s process the event?
s
I think @Marcelo Olivas mend DLQ for when the events fail to be delivered to a target like a lambda, right? Which is configured on the target as option like this in addition to the example Frank gave:
Copy code
const queue = new sqs.Queue(this, 'Queue')

rule.addTarget(new targets.LambdaFunction(processor, {
  deadLetterQueue: queue,
}))
PS. i recently implemented this^
f
Ah yeah thanks @Sione, or you can add a DLQ to an
sst.Function
at anytime like
Copy code
const queue = new sst.Queue(this, "ProcessorDLQ");
const processor = new sst.Function(this, "Processor", {
  handler: "processor.main",
  deadLetterQueue: queue.sqsQueue,
});