user33262
user33262

Reputation: 11

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!

Upvotes: 0

Views: 1002

Answers (2)

Connor
Connor

Reputation: 23

Do you know where is the invoke failed logs?

I have a lambda function. It's deployed by serverless. So a rule always be created in my custom event bus automatically. After I send a test event to my bus. This rule can be triggered. But is always invoke fail. I try to find the reason but nothing can be saw beside invoke metrics.

Strangely, if I manually create a rule for the same. This manually created rule can always fire and successfully invoke the lambda function.

Upvotes: 0

user33262
user33262

Reputation: 11

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!

Upvotes: 0

Related Questions