3 ms·
Probably lost in all the replies but use can use AWS SAM start-local[1] to run a lambda locally. There's also a docker container to mock dynamodb locally. Whe
by ldoughty 6y ago
Probably lost in all the replies but use can use AWS SAM start-local[1] to run a lambda locally.
There's also a docker container to mock dynamodb locally.
When I'm just working logic... Unit tests are best, but you could also keep the lambda invitation endpoint to lambda_handler, then write your own main() function to do some setup (like assume role to the same role as the lambda execution role, set up env bars)... Then end by invoking your lambda_handler locally... Basically main() is your pathway to running the lambda locally.. with only the minimum code required to "fake" being an AWS lambda.
1: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-local-start-lambda.html https://docs.aws.amazon.com/serverless-application-model/lat...