What ZAPPA does when you call deploy

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!

My First Serverless App

To start the Serverless hello-world application with Python + Flask and Zappa, refer to the steps mentioned in my previous post

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:

  • Lambda-compatible manylinux wheels from a local cache
  • Lambda-compatible manylinux wheels 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
  1. Zappa will automatically package up your application and local virtual environment into a Lambda-compatible archive
  2. Replace any dependencies with versions precompiled for Lambda
  3. Set up the function handler and necessary WSGI Middleware
  4. Upload the archive to S3 mentioned in zappa_settings.json
  5. Create and manage the necessary Amazon IAM policies and roles
  6. Register it as a new Lambda function
  7. Create a new API Gateway resource
  8. Create WSGI-compatible routes for it, link it to the new Lambda function

Also published on Medium.

Leave a Reply

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