Docker image for AWS SAM local.
___________
< SAM local >
-----------
\
\
\
## .
## ## ## ==
## ## ## ## ===
/""""""""""""""""___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\______/
Main idea is to give possibility to develop and test AWS SAM applications without AWS involvement and charging.
You can make direct invocation of particular lambda functions or use APIG-interface to call them.
Two runtimes are present in examples: Pytnon and NodeJS. Examples have been made to provide simple and clear view how it works. Examples are identical in the result and almost identical in code-style and formatting.
Feel difference :)
This image can either be used as a image for building on top of SAM-local or just to experiment with. I personally have not attempted to use this in a production use case.
Ensure the following pre-requisites are met.
- Linux, Mac, Windows + WSL
- Docker 1.10+
- Clone or download this project code
- Go to
docker-sam-local
directory
Please bear in mind that syntax of commands remains intact despite dockerization
./sam
./sam validate
or
./sam validate -t template.yaml
echo '{"name":"Jude"}' | ./sam local invoke python
./sam local invoke -e event.json node
Don't be confused by calling functions node or python. Those are resource names in my template.yaml file. Just for fun.
./sam local start-api
In service mode you can use your browser or curl to call particular functions by REST-API:
curl http://localhost:3000/python/Jude
curl -d '{"test":"payload"}' http://localhost:3000/node/Vanessa