Zappa
If you decide to write your functions in Python, then you can use Zappa to deploy them. Zappa is a CLI/command-line framework, and it is open source. Zappa currently supports Python WSGI applications, which are basically Flask and Django applications. It can deploy macro and micro applications. Zappa has a wide variety of features, such as the ability to deploy functions like API to AWS lambda and AWS API Gateway respectively. It can also configure AWS events sources.
Once deployed, we can also invoke the function through Zappa. It can fetch or tail the logs from the AWS. It also allows rollback to the previous version. We can set up multistage deployment (by stage, it means multiple environment deployments, such as dev, qa, uat, and prod).
Zappa also has the cool feature of being able to keep the Lambda function warm. This makes for better performance and decreases latency, to an extent. It allows us to schedule deployment, which means that we can set up deployment earlier on in the day so that it does not interfere with regular traffic. It has the ability to undeploy the purging of logs from the CloudWatch. We can also use it to package the Lambda functions for future deployment. Post deployment status can also be checked through Zappa. Zappa allows us to deploy the Lambda function to any region in AWS. Let's look at a few of Zappa's features:
- Installation of Zappa: To install Zappa, you need to make sure that you have Python 2.7 or older, and that you have PIP installed and configured on your local machine or laptop. You also need to make sure that your AWS credentials are set up (https://aws.amazon.com/blogs/security/a-new-and-standardized-way-to-manage-credentials-in-the-aws-sdks/). We need Python and pip to install Zappa on the local environment:
$ pip install zappa
- Zappa init: The init code phrase will set up deployment settings. It should automatically detect the Flask/Django application and it will create a JSON file named zappa_settings.json within the project directory:
$ zappa init
- Packaging and deployment: Once the settings are configured, we can package and deploy the application using the following command. By default, it uses the production stage, but we can create multiple different stages:
$ zappa deploy production
Zappa is an awesome framework, but there are a few cons about it, such as the fact that it does not support other cloud providers, such as Azure, Google, and OpenWhisk. It only supports Python-WSGI-based applications and no other languages, such as Node.js.
https://www.zappa.io/