Top serverless plugins we are using

Hoang Le
INNOMIZE
Published in
4 min readNov 8, 2019

--

This post is originally published on our blog.

We are using the Serverless framework for a couple of years and building a lot of applications. So I wanted to summarize and provide a brief description of some plugins that our team is using every day. I am not sure it is good for you, if you have any recommendations, just let us know.

If you haven’t yet checked out this list of Serverless Framework plugins, you’re missing out. Or you can read this post for a short version.

Don’t Reinvent The Wheel

Don’t build it again if someone else already built it and open-sourced it for you.”. It’s free to use and the community support revolves around building, fixing, and maintenance.

serverless-offline

I believe this is the most popular plugin, almost Serverless developers have used it at least one time. This Serverless plugin emulates the AWS Lambda function and API Gateway on your local machine to speed up your development cycles.

Along with using serverless-offline, our team also uses some plugins that support emulating cloud services on our local machine such as:

serverless-webpack and serverless-plugin-typescript

It is easy to get started with zero-config by using serverless-plugin-typescript plugin for small projects. But for large scale projects, we are using the serverless-webpack plugin that allows us to define our webpack configuration for bundling TypeScript code.

If you are using paths configuration in the tsconfig.json file, then you might need to use tsconfig-paths-webpack-plugin plugin to automatically load modules based on the location specified in the paths config

serverless-iam-roles-per-function

This plugin allows us to define the IAM roles per functions instead of using a single IAM role for all Lambda functions. Yan Cui has listed this plugin as 2nd serverless best practice on this post

serverless-domain-manager

We use this plugin to create custom domains for API Gateway.

serverless-plugin-split-stacks

To avoid reaching the 200 resources limit of our CloudFormation error, we use this plugin to split the main stack into multiple stacks.

serverless-plugin-warmup

How to reduce cost starts for Lambda functions? The question that a lot of developers are asking and trying to reduce cost starts. There are more solutions but one of them is using this plugin. It solved the cost starts by using a scheduled task that will invoke selected functions in a configurable interval (default is 5 mins, but we almost use 45 mins as the average interval that the Lambda function keep-alive)

serverless-plugin-aws-alerts

We use this plugin to define CloudWatch alarms for Lambda functions by using default definitions or adding log metric filters to log groups.

serverless-secrets-plugin

Store some environment variables that we can commit to source control and share across teams. But for storing sensitive information, we use @middy/ssm middleware to fetch SSM parameters.

serverless-vpc-plugin

If you want to run your Lambda functions under your private VPC and want to define new VPC when deploying serverless, then use this plugin. You also can use serverless-vpc-discovery plugin to retrieve an existing VPC from your AWS account.

serverless-mysql

Use this plugin to manage MYSQL connections at scale.

serverless-apigateway-service-proxy

If you want to expose API for SNS, SQS, S3, and Kinesis Streams, then you can use this plugin without Lambda, also AWS resources will be created by that plugin.

And a few more as below:

serverless-plugin-canary-deployments this plugin supports Blue/green deployment for your Lambda.
serverless-pseudo-parameters this plugin allows using CloudFormation Pseudo Parameters in your serverless.yml
serverless-s3-deploy uses this plugin to sync your directory to a S3 bucket, we have used it for deploying our static website.
serverless-api-stage support defining stage variables, logging configuration (for AWS provider)
serverless-aws-alias this plugin enables the use of AWS aliases on Lambda functions, for example you can use this plugin to deploy multiple environments for different VCS branches.
serverless-s3-remover you cannot delete an S3 bucket with data, right? This plugin will solve that problem. It will prompt you to remove its data before removing Cloud Formation stack.
serverless-ses-template if you are using SES Template, right now AWS doesn’t provide UI to upload or edit templates on the Console Management, you can only use API to upload templates. This plugin will do that for you, it automatically creates, updating, and removes AWS SES Templates using a configuration and keeps your AWS SES Templates synced with your configuration file.

--

--

Hoang Le
INNOMIZE

Co-Founder, CTO at @innomizetech | Software Architect, Full-stack DEV | Passionate about #cloudcomputing #aws #serverless #devops #machinelearning #iot #startup