Running and testing AWS Lambda container images locally

If you are packaging a Lambda as a Docker container image, to run locally start with:

docker run -p 9000:8080 your-image-name

And then to test you can post requests to the running container with curl:

curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{ "example": "value" }'

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.