Serverless deployment is a key consideration when starting to write software using Function-as-a-Service services such as AWS Lambda. In the beginning, the default cloud vendor’s console is the starting point. However, once the application gains some complexity, a proper serverless 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 this article covers.
- 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 gcloud command-line tool is the recommended way.
- IBM Cloud offers the IBM Cloud CLI.
Serverless Deployment Platforms
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.
AWS SAM – the AWS Way to Deploy Serverless
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 method of defining AWS Lambda functions, API Gateway, and DynamoDB tables. In addition, it supports the runtime of the Lambda functions. AWS SAM only supports applications deployed on AWS.
The SAM format is used to describe AWS SAM applications. The format is either JSON or YAML and deployed using the AWS SAM CLI. If you want to get started with AWS SAM, you should check out this guide. The active Slack channel is also a great resource to check.
Pulumi – Holistic Serverless Deployment
Pulumi is the “Cloud Native Infrastructure as Code” framework. It aims to provide a cloud development model for serverless functions, container apps, and data infrastructure for any cloud. Using the Pulumi CLI tool, Pulumi enables its users to deploy to different providers: AWS, Azure, GCP, OpenStack, and even Kubernetes.
In addition, Pulumi also created the Pulumi Cloud Framework. It lets you program infrastructure and application logic, particularly suitable for serverless applications, and being cloud-agnostic. Finally, Pulumi has an active Slack community, and it is also available on GitHub.
Serverless Framework – The Command Line Approach
The Serverless Framework is an open-source tool for managing and deploying serverless functions. It supports multiple programming languages and cloud providers.
Moreover, earlier this year, it introduced two additional tools. The first is Event Gateway, which provides an abstraction layer to design complex serverless applications quickly. The second is the Serverless Dashboard, for better management of the application, as well as collaboration.
To describe a Serverless Framework application, you need to use as YAML files (known as serverless.yml) which define 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 and its GitHub page contains many examples.
Check out our Slack bot AWS Lambda function and the Lambda+SQS examples to get a sense of a simple deployment of AWS Lambda. The Epsagon plugin is a popular way to use Epsagon together with Serverless Framework. There also useful open-source tools, such as this one for packaging external code in AWS Lambda using Serverless Framework.
Stackery – The Visual Way
Stackery promises to be the best toolkit for serverless development for teams. Unlike AWS SAM and Serverless Framework, from day one Stackery introduced a dashboard for visually designing and building serverless applications. Besides, it does provide a standard CLI as well, and also announced that it is now built on AWS SAM.
In addition to creating and deploying serverless applications, Stackery also provides robust collaboration tools for teams. Key features include rollback protection, automatic build packaging, and a GitHub integration. Epsagon and Stackery have a simple integration that will allow automatically provide Epsagon’s monitoring for any Stackery user.
Other Serverless Deployment Tools
Unlike platforms, tools are suitable for specific tasks and mostly provide automation around them.
AWS Chalice
Chalice is a framework by AWS for writing serverless applications in Python. It provides a command-line tool for building, deploying, and managing AWS Lambda applications. There are integrations with common AWS services and automatic IAM policy generation. Chalice is available on GitHub.
Apex
Apex is a framework which aims to let you quickly build, deploy, and manage AWS Lambda. A great benefit of Apex is the ability to use languages that are not natively supported by AWS Lambda. It does so 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.
Architect
If you are deploying AWS Lambda functions in Node.js, you should check out Architect. As a framework, it uses a plaintext manifest to describe cloud infrastructure, including version control, fast deployment and working locally. Architect is available on GitHub.
Claudia.js
A favorite 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. Also, it does so using only standard NPM packages and makes it easy to manage multiple versions. Claudia.js is available on GitHub.
Sparta
The Go programming language is becoming more and more popular. Earlier this year, AWS announced the Go support for AWS Lambda. Sparta is a framework that transforms a standard Go application into a self-deploying AWS Lambda powered service.
All configuration and infrastructure requirements are written as Go types as well. Sparta is available on GitHub.
Terraform
The popular 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.
Zappa
Probably the most popular tool for deploying serverless web services in Python. Zappa enables to quickly deploy web applications, usually written in Flask or Django. The framework wraps the standard application and deploys a Lambda function to allow a serverless, scalable experience. Zappa is available on GitHub.
Summary
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, they all have a common goal. They all aim enable developers to iterate faster in serverless, without losing their heads.
Deployment is just one part of the serverless journey. Other aspects include performance, testing, security, debugging, and monitoring. To enable a fully-serverless state of mind, we will have to address every one of them.