When starting to write software in serverless and Function-as-a-Service, the default cloud vendor’s console is the starting point. However, once the application gains some complexity, a proper deployment tool is necessary. This post covers the most popular deployment tools for serverless
The Cloud Provider’s Way
Each of the cloud vendors provides an easy way to deploy functions:
- AWS has a CLI for deploying Lambda functions, as well as two tools (SAM and Chalice) which are covered in this article.
- Microsoft Azure recommends using Visual Studio for deploying functions, and it also enables doing so using the Azure CLI.
- Google Cloud provides different ways of deploying Cloud Functions. The
gcloudcommand-line tool is the recommended way.
- IBM Cloud offers the IBM Cloud CLI.
Serverless deployment platforms enable more than just deploying your code -- their features vary from modeling the serverless application, code management, visualization, and multi-cloud support.
SAM -- Serverless Application Model -- is a way to describe and deploy serverless applications in a simple way. It extends the AWS CloudFormation to provide a simplified way of defining AWS Lambda functions, API Gateway, and DynamoDB tables. It supports the runtime of the Lambda functions. AWS SAM only supports applications deployed on AWS.
Describing an application using AWS SAM (source: AWS)
Deploying a function using the AWS SAM CLI (source: AWS)
Aspiring to be the “Cloud Native Infrastructure as Code” framework, Pulumi aims to provide a cloud development model for serverless functions, container apps, and data infrastructure for any cloud. The
Deploying and managing infrastructure using Pulumi (source: TechCrunch)
The Serverless Framework is an open-source tool for managing and deploying serverless functions. It supports multiple programming languages and cloud providers. Earlier this year, it introduced two additional tools -- Event Gateway, which provides an abstraction layer to easily design complex serverless applications, and Serverless Dashboard, for a better management of the application, as well as collaboration. Serverless Framework applications are written as YAML files (known as serverless.yml) which describe the functions, triggers, permissions, resources, and various plugins of the serverless application.
A comparison of Serverless Framework vs. other tools provides some insights into the differentiation of the framework. Serverless Framework has an active GitHub community. Many examples to get started can be found on the GitHub page.
Deploying an application using Serverless Framework (source: serverless.com)
In addition to creating and deploying serverless applications,
Building serverless applications visually using
Unlike platforms, tools are suitable for specific tasks and mostly provide automation around them.
Chalice is a framework by AWS for writing serverless applications in
Apex is a framework which aims to let you easily build, deploy, and manage AWS Lambda. One of the key features of Apex is the ability to use languages that are not natively supported by AWS Lambda through the use of a Node.js shim injected into the build. In addition to building and deploying the functions, other related tools provide testing, deployment roll-backs, and log tailing. Apex is available on GitHub.
If you are deploying AWS Lambda functions in Node.js, you should check out Architect. This framework uses a plaintext manifest to describe cloud infrastructure, including version control, fast
A popular project among developers using AWS Lambda, Node.js, and API Gateway, is Claudia.js. It enables to deploy an AWS Lambda and API Gateway applications with a single command, using only standard NPM
The Go programming language is becoming more and more popular, and together with the announcement of Go support for AWS Lambda earlier this year, Sparta is a framework that transforms a standard Go application into a self-deploying AWS Lambda powered service, while all configuration and infrastructure requirements are written as Go types as well. Sparta is available on GitHub.
The well-known Infrastructure as Code service, Terraform is used to manage and deploy cloud stacks across different providers. It also provides a way to deploy serverless applications, including AWS Lambda and API Gateway.
Probably the most popular tool for deploying serverless web services in Python, Zappa enables to easily deploy web applications, usually written in Flask or Django. Zappa wraps the standard application and deploys a Lambda function to enable a serverless, scalable experience. Zappa is available on GitHub.
As we can see, over the past two years, many tools for deploying and managing serverless applications have emerged. Each of these tools has a different focus, but in the end,
Obviously, deployment is just one part of the serverless journey. Other aspects include performance, testing, security, debugging, and monitoring. Each of these has to be resolved to in order to enable a fully-serverless state of mind.