Search code examples
amazon-web-servicesaws-lambdaaws-event-bridge

AWS lambda event bridge handler not invoked


i have a lambda for some processing and another one to handle errors of the processing lambda. I wired those via a custom eventbus and a rule in it.

my event rule pattern looks like this:

{
  "source": ["lambda"]
}

while the policy statement is exactly like in here https://aws.amazon.com/premiumsupport/knowledge-center/eventbridge-lambda-not-triggered/

Generally i followed the troubleshooting guide (several times), but i simply dont receive the lambda error events (other events, e.g. from sagemaker i use somewhere else work fine)

The events are also not shown in the event bus metrics.

Do i have to add some special configuration to the "event emitting" lambda (in my case the processor). Of course i have configured the custom event bus as "on failure" destination (asynchronous in my case), but are there any other things required like permissions or so?

hope someone can help me,

cheers!


Solution

  • okay, i found the answer myself and actually it's quite simple and can be found if the docs are studied thoroughly.

    destinations work only when lambdas are invoked asynchronously, which is supported by a number of input triggers (e.g. sns).

    my lambda however listenes on sqs queues and since they rely on event source mappings, which in turn invoke the lambda synchronously, destinations are not supported. rather the batch is rejected until a message is eventually moved to dead-letter...

    maybe i can help someone with the answer in the future; although i have to admit it's quite clear once you read the documentation.

    as a solution i moved to a more explicit error handling approach, by actively submitting message on the event bus.

    cheers!