Can zappa be used to run functions directly (not wsgi applications)

zappa can easily be used to launch flask applications. But it only creates one lambda function for each application. Can I have a separate lambda function for each python function that I declare?

+4
source share
2 answers

You can create trigger events for the command as shown below and zappa will call your python function:

{ 
  "command": "mymodule.myfunction"
}

Your application does not have to be a wsgi application. You can create each lambda function individually and download the same zappa package as zip on each of them.

+3
source

SO, zappa -wsgi, .

Zappa AWS Lambda , WSGI, - :

myapp.py

def foo(event, context):
    print('foo bar')
    return 'lambda triggered!'

zappa_settings.json

{
    "dev": {
        "lambda_handler": "myapp.foo",
        ...
    }
}

AWS Lambda "" , .

+1

Source: https://habr.com/ru/post/1679999/


All Articles