pythondjangozappa

Zappa Django one lambda per app in a monorepo


My Django REST API is composed of multiples apps, one app per resource like that:

├── core
│   ├── settings.py
│   ├── urls.py
├── customers
│   ├── models.py
│   ├── serializers.py
│   ├── urls.py
│   └── views.py
├── orders
│   ├── models.py
│   ├── serializers.py
│   ├── urls.py
│   └── views.py

The settings of the app are all in core/settings.py.

How can I tell zappa to deploy each app in a different lambda function and configure API Gateway to handle the routing for each app?


Solution

  • I suggest you add a stage per app in your zappa_settings.json file. Then you can deploy each stage independently.

    See the documentation for exact formatting.