I have a an aws lambda that I would like to be able to invoke locally utilizing sam local invoke "MyFunction" -e event.json
, but my event.json file never seems to be correct. For example, if my lambda connects to DynamoDB, I get an error like "The security token included in the request is invalid."
Is there a way to run a functional lambda in the cloud and generate/output the event.json (e.g. as if it were invoked from API Gateway) so that you can then use it locally?