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?

回答なし

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ