zappa can easily be used to run flask apps. But it creates just one lambda function per app. Can I have a separate lambda function for each python function I declare?
Zappa is a full-featured command-line tool that Lambda-fies Flask and Django applications. Technically speaking, it's a framework that packages and deploys WSGI-compatible Python applications to an AWS Lambda function. Zappa is an "easy button" for Flask and Django serverless deployment.
Zappa is an open source tool that was developed and designed by Rich Jones, founder/CTO of Gun.io (https://www.gun.io/). Zappa was mainly designed to build and deploy serverless Python applications on AWS Lambda and API Gateway.
What's the modular path to your app function? (default dev) The AWS Lambda function requires an attribute, such as lambda_handler, which points to a function as an entry point for Lambda execution. Hence, you need to provide information about the function name with a modular path such as <filename>.
Since this is the first SO result that you get when searching for zappa for non-wsgi I'll share my 2 cents.
If you just want use Zappa to deploy to AWS Lambda and be able to invoke your function without actually using WSGI you can do something like this:
def foo(event, context):
print('foo bar')
return 'lambda triggered!'
{
"dev": {
"lambda_handler": "myapp.foo",
...
}
}
Now go to your AWS Lambda console in browser and click Test and see the function being triggered.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With