简体   繁体   中英

How to see the event notification from s3 to lambda

Where do I see the event notification sent (the json structure event) from S3 to lambda in the case a lambda function is triggered by an S3 event. It is possible to capture that in cloudwatch?

As mentioned in the comments, the S3 event notification is passed as the event argument to your Lambda handler.

This isn't logged automatically anywhere (unlike general invocation information like request ID, memory size, memory usage etc).

To view the event, you need to manually log this in your Lambda & then view it in CloudWatch.

Actually the answer to your question is simple... Use print(event) to post it to the CloudWatch logs of the function.

Create a lambda function:

def handler_name(event, context): 
    print(event)

Configure this function to be triggered on an S3-upload.

https://docs.aws.amazon.com/lambda/latest/dg/with-s3-example.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM