Top serverless plugins we are using
Tags: serverless, aws, opensource
Published: 2019-11-06 09:06:26

This post is originally published on [our blog](https://innomizetech.com/blog/top-serverless-plugins-we-are-using).

<!-- wp:paragraph -->
<p>We are using the  <a href="https://serverless.com/">Serverless</a> 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.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>If you haven't yet checked out this<a href="https://github.com/serverless/plugins"> list of Serverless Framework plugins</a>, you're missing out. Or you can read this post for a short version.</p>
<!-- /wp:paragraph -->

<!-- wp:quote {"align":"center","className":"is-style-large"} -->
<blockquote style="text-align:center" class="wp-block-quote is-style-large"><p>Don't Reinvent The Wheel</p></blockquote>
<!-- /wp:quote -->

<!-- wp:paragraph -->
<p>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 that revolves around building, fixing, and maintenance.</p>
<!-- /wp:paragraph -->

<!-- wp:more -->
<!--more-->
<!-- /wp:more -->

<!-- wp:paragraph -->
<p><a href="https://www.npmjs.com/package/serverless-offline">serverless-offline</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>I believe this is the most popular plugin, almost&nbsp;<a href="https://serverless.com/">Serverless</a>&nbsp;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.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Along with using&nbsp;<a href="https://www.npmjs.com/package/serverless-offline">serverless-offline</a>, our team also use some plugins that support emulate cloud services on our local machine such as:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><li><a href="https://github.com/99xt/serverless-dynamodb-local">serverless-dynamodb-local</a></li><li><a href="https://www.npmjs.com/package/serverless-step-functions-offline">serverless-step-functions-offline</a></li><li><a href="https://github.com/ar90n/serverless-s3-local">serverless-s3-local</a></li></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p><a href="https://github.com/serverless-heaven/serverless-webpack">serverless-webpack</a>&nbsp;and&nbsp;<a href="https://github.com/prisma-labs/serverless-plugin-typescript">serverless-plugin-typescript</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>It is easy to get started with zero-config by using&nbsp;<a href="https://github.com/prisma-labs/serverless-plugin-typescript">serverless-plugin-typescript</a>&nbsp;plugin for small projects. But large scale projects, we are using the&nbsp;<a href="https://github.com/serverless-heaven/serverless-webpack">serverless-webpack</a>&nbsp;plugin that allows us defining our&nbsp;<a href="https://webpack.js.org/">webpack</a>&nbsp;configuration for bundling TypeScript code.</p>
<!-- /wp:paragraph -->

<!-- wp:quote -->
<blockquote class="wp-block-quote"><p>If you are using&nbsp;<em>paths</em>&nbsp;configuration in the tsconfig.json file, then you might need to use&nbsp;<a href="https://www.npmjs.com/package/tsconfig-paths-webpack-plugin">tsconfig-paths-webpack-plugin</a>&nbsp;plugin to automatically load modules based on the location specified in the <em>paths</em> config</p></blockquote>
<!-- /wp:quote -->

<!-- wp:paragraph -->
<p><a href="https://www.npmjs.com/package/serverless-iam-roles-per-function">serverless-iam-roles-per-function</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>This plugin allows us to define the IAM roles per functions instead of using a single IAM role for all Lambda functions.&nbsp;<a href="https://twitter.com/theburningmonk">Yan Cui</a>&nbsp;has listed this plugin as 2nd serverless best practice on&nbsp;<a href="https://www.datree.io/resources/serverless-best-practices">this post</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><a href="https://github.com/amplify-education/serverless-domain-manager">serverless-domain-manager</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>We use this plugin to create custom domains for API Gateway.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><a href="https://github.com/dougmoscrop/serverless-plugin-split-stacks">serverless-plugin-split-stacks</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>To avoid reaching out the&nbsp;<a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html">200 resources limit our CloudFormation</a> error, we use this plugin to split the main stack into multiple stacks.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><a href="https://www.npmjs.com/package/serverless-plugin-warmup">serverless-plugin-warmup</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>How to reduce cost starts for Lambda functions? The question that a lot of developers are asking and try to reduce cost start. 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)</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><a href="https://github.com/ACloudGuru/serverless-plugin-aws-alerts">serverless-plugin-aws-alerts</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>We use this plugin to define CloudWatch alarms for Lambda functions by using default definitions or add log metric filters to log groups.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><a href="https://github.com/serverless/serverless-secrets-plugin">serverless-secrets-plugin</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Store some environment variables that we can commit to source control and share across teams. But for storing sensitive information, we use&nbsp;<a href="https://www.npmjs.com/package/@middy/ssm">@middy/ssm</a>&nbsp;middleware to fetch SSM parameters.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><a href="https://github.com/smoketurner/">serverless-vpc-plugin</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>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&nbsp;<a href="https://www.npmjs.com/package/serverless-vpc-discovery">serverless-vpc-discovery</a>&nbsp;plugin to retrieve an existing VPC from your AWS account.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><a href="https://github.com/jeremydaly/serverless-mysql">serverless-mysql</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Use this plugin to manage MYSQL connections at scale.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><a href="https://github.com/horike37/serverless-apigateway-service-proxy">serverless-apigateway-service-proxy</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>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. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>And a few more as below:</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><a href="https://github.com/davidgf/serverless-plugin-canary-deployments">serverless-plugin-canary-deployments</a> this plugin supports Blue/green deployment for your Lambda.<br><a href="https://www.npmjs.com/package/serverless-pseudo-parameters">serverless-pseudo-parameters</a> this plugin allows using <a href="http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html">CloudFormation Pseudo Parameters</a> in your <code>serverless.yml</code><br><a href="https://www.npmjs.com/package/serverless-s3-deploy">serverless-s3-deploy</a> use this plugin to sync your directory to a S3 bucket, we have used it for deploying our static website.<br><a href="https://www.npmjs.com/package/serverless-api-stage">serverless-api-stage</a>  support defining stage variables, logging configuration (for AWS provider)<br><a href="https://github.com/serverless-heaven/serverless-aws-alias">serverless-aws-alias </a>this plugin enables use of AWS aliases on Lambda functions, for an example you can use this plugin to deploy multiple environments for different VCS branches.<br><a href="https://github.com/sinofseven/serverless-s3-remover">serverless-s3-remover</a> 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.<br><a href="https://github.com/haftahave/serverless-ses-template">serverless-ses-template</a> 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 template. This plugin will do that for you, it automatically creating, updating and removing AWS SES Templates using a configuration and keeps your AWS SES Templates synced with your configuration file.</p>
<!-- /wp:paragraph -->