Reputation: 1131
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?
Upvotes: 2
Views: 2167
Reputation: 238061
Based on the comments.
SAM has number of test events available for use from many different services, including api gateway and dynamodb.
The test events can be accessed using sam local generate-event command.
Upvotes: 1