Docker has a large cold start time usually, sometimes it can take up to 10 seconds for a dockerized Python lambda to invoke. Are there solutions for that, that include docker?
Fair point, I’m working on a project now that doesn’t require responsiveness - it’s not user facing. We were burned so bad by Lambda cold starts for user facing lambdas that were backing websites we said forget it and just used ECS/fargate. This is my go to template - I didn’t write it. I found it 7 years ago.
You just update the parameter for your container image and redeploy.
Of course you have provisioned concurrency that can help.
But the easiest way to test Python lambdas locally is just to run it like any other Python script and call your event handler with the event you want to test
Fair point, I’m working on a project now that doesn’t require responsiveness - it’s not user facing. We were burned so bad by Lambda cold starts for user facing lambdas that were backing websites we said forget it and just used ECS/fargate. This is my go to template - I didn’t write it. I found it 7 years ago.
https://github.com/1Strategy/fargate-cloudformation-example/...
You just update the parameter for your container image and redeploy.
Of course you have provisioned concurrency that can help.
But the easiest way to test Python lambdas locally is just to run it like any other Python script and call your event handler with the event you want to test