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?

No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions