Events getting nested/wrapped when passing them from DLQ with Eventbridge Pipe to Lambda?

0

I´m having difficulties to properly handle events which are passed to a target lambda by eventBridge Pipe.

Here is what i´m doing:

  • I´m using a DLQ for failed Cloudwatch Event invocations on Lambda (using Lambda function DeadLetterQueue property)
  • I´m using an Eventbridge Pipe to get the Events from the DLQ and passing them to another target Lambda function.
  • In the target´s lambda handler i´m using *events.CloudWatchEvent as incoming parameter.

When the target lambda is invoked it seems that i´m receiving a nested Event structure with other Events as body/detail:

CloudwatchEvent from Pipe

SQS Message from DLQ

original CloudwatchEvent

With this behavior i´m forced to unmarshal all of the three event levels to get the original event i´m searching for.. In all of the documentations of eventPipes it is never mentioned that you have to do such explicit manual handling of nested event structures. If this is normal behavior you always would have to write specific code to retrieve the event you are looking for..

Question:
Is this expected behavior or am i doing something wrong here?
Is there a way to get the original event which was pushed to the DLQ directly in the target lambda?

gema
已提問 2 個月前檢視次數 263 次
沒有答案

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南