When developing the lambda function it's useful to run and debug the code locally. This can be achieved with the following tooling.
Using SAM the lambda function can be deployed in a AWS like environment as a docker container.
To run the function with SAM:
- Ensure the project is built and packaged e.g.
mvn verify
- Run corresponding script found here.
- Wait until the script has deployed the lambda to docker
- Attach a remote debugger with the following configurations:
- IDE:
port=5005 host=localhost
- VM command:
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
- IDE:
- Debug code and execution will complete
The sam function will use the cloud formation template found here and the event information found here