How to see the event that triggered a lambda?

Is there a way to view the entire event that was passed to a lambda (say from a DDB Stream) without printing the entire event inside the lambda?

Perhaps creating a CloudTrail trail that captures Lambda events will show the event. Just be mindful of pricing.

Not to my knowledge. Have to print/log it somewhere.

We’re using https://lumigo.io/ to trace our lambda functions and it’s a great deal in terms of what you’re paying and what you’re getting

Cloudtrail might show it but our group always defaults to printing it and letting it get captured in CWL

If such a mechanism would exist enabled by default, it would be expensive and a security and privacy nightmare. It would mean AWS is keeping a copy of all the data flowing into your system somewhere. That’s a big no no. That event could have passwords, addresses, anything.

That being said, if you know this not to be an issue and want to build something that does it without logging maybe put something in front of the lambda, like an SNS topic that also delivers the event to a database or another lambda.

If you can modify the lambda and just want to separate your concerns, add a lambda layer in front of your original one. This can log or do whatever you want with it.

You could just log the event as long as it doesn’t contain sensitive data

That’s what I do in debug mode.

There are mainly two ways. For example,

  1. track them by creating log history file at your S3 bucket.
  2. track them by creating log history table inside your SQLite database as well.