This project demonstrates deploying a Flask web application serverlessly using AWS Lambda and API Gateway, powered by Zappa.
🐍 Zappa and AWS Lambda do not support Python 3.13 or newer.
If you are using Python 3.13+ locally, you must install Python 3.9 or any version between 3.7 and 3.12 to ensure compatibility.
Use tools like pyenv to manage multiple Python versions.
Example:
pyenv install 3.9.18
pyenv local 3.9.18- Flask (Python micro-framework)
- AWS Lambda (serverless runtime)
- API Gateway (HTTP endpoint)
- Zappa (Python tool for serverless deployments)
- S3 (for deployment package storage)
- Serverless HTTP API
- 100% pay-as-you-go (no EC2 or servers running)
- Easy CI/CD potential with GitHub + Zappa
- Great for small APIs, webhooks, and lightweight services
flask-serverless/
├── app.py
├── requirements.txt
├── zappa_settings.json
└── venv/
python3 -m venv venv
source venv/bin/activate
pip install flask zappazappa init
zappa deploy dev
zappa update dev
Once deployed, visit:
https://your-api-id.execute-api.us-east-1.amazonaws.com/dev/ Response: Hello From Flask on AWS Lambda!
zappa undeploy dev
-
Rebuild using Terraform (Lambda, API Gateway, IAM)
-
Add CI/CD via GitHub Actions