Miserlou / Zappa

Serverless Python
https://blog.zappa.io/
MIT License
11.89k stars 1.21k forks source link

Update/deploy a lambda using a Docker container image #2192

Closed ian-whitestone closed 1 year ago

ian-whitestone commented 3 years ago

Background

As discussed in #2188, AWS recently announced container image support for AWS Lambda. This means you can now package and deploy lambda functions as container images, instead of using zip files. The container image based approach will solve a lot of headaches caused by the zip file approach, particularly with file sizes (container images can be up to 10GB) and the dependency issues we all know & love.

What does this PR do?

  1. Make the zappa update and zappa deploy commands accept a new docker_image_uri parameter. docker_image_uri must point to an image in Elastic Container Registry (ECR) that complies with these guidelines. Instructions on how to configure this docker image will be provided in an accompanying blog post.
  2. Add a new save-python-settings-file CLI command, which will be used to generate & save the zappa_settings.py file that must be included in your docker image

Reproducible example

See this repo which contains an example Dockerfile that can be used for testing.

Discussion points for reviewers

Future Work & Next Steps

coveralls commented 3 years ago

Coverage Status

Coverage decreased (-16.6%) to 56.417% when pulling 9dfdf8cc6700973a35a3b433258adaee2803b107 on ian-whitestone:add-docker-support into 542c8c60291ebc5ece03b8dd4abe9e0172715086 on Miserlou:master.