gerrykou / local-lambda

Test a Python AWS Lambda locally using Docker and Docker compose
1 stars 0 forks source link
aws aws-lambda docker docker-compose python

local-lambda

How to test a Docker AWS Lambda locally using docker compose.

We 'll follow instruction from here, (Optional) Test the image locally section.
But we 'll use docker compose and the Compose Watch feature.

Start the container

docker compose up --watch

Invoke the Lambda

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

Stop the running container

docker compose down

Use docker compose down -v if you mounted volumes in your compose.yaml file.

Screen recording preview on youtube