Q:

sam local start-lambda - how to send send s3 event to sam local endpoint

I can invoke a local lambda http endpoint (sam local start-lambda), but how do I trigger that lambda endpoint with a (mock) AWS event (s3, etc.) like I can when using the Dockerized lambda environment (sam local invoke -e event.json myLambdaFunction)?  
I want to trigger an s3 event on the locally running lambda endpoint just like I can on a lambda deployed to AWS.

A:

First you generate the sample function payload:

sam local generate-event s3 put --bucket bucket-name --key key-name > event_file.json

Then you invoke your function with the payload:

sam local invoke function-name -e event_file.json

More info is in the official documentation.

