Zappa makes it super easy to build and deploy server-less, event-driven Python applications (including, but not limited to, WSGI web apps) on AWS Lambda + API Gateway. Think of it as “serverless” web hosting for your Python apps. That means infinite scaling, zero downtime, zero maintenance – and at a fraction of the cost of your current deployments!
Credits to Zappa Docs
Zappa will automatically package your active virtual environment into a package that runs smoothly on AWS Lambda.
During this process, it will replace any local dependencies with AWS Lambda compatible versions. Dependencies are included in this order:
manylinuxwheels from a local cache
manylinuxwheels from PyPI
- Packages from the active virtual environment
- Packages from the local project directory
It also skips certain unnecessary files, and ignores any .py files if .pyc files are available.
In addition, Zappa will also automatically set the correct execution permissions, configure package settings, and create a unique, auditable package manifest file.
> zappa deploy dev
- Zappa will automatically package up your application and local virtual environment into a Lambda-compatible archive
- Replace any dependencies with versions precompiled for Lambda
- Set up the function handler and necessary WSGI Middleware
- Upload the archive to S3 mentioned in zappa_settings.json
- Create and manage the necessary Amazon IAM policies and roles
- Register it as a new Lambda function
- Create a new API Gateway resource
- Create WSGI-compatible routes for it, link it to the new Lambda function
Also published on Medium.