This article highlights a selection of open source tools to improve the developer experience of building with Serverless.
Some of these tools are specific to AWS Serverless and the Serverless Framework.
In no particular order…
1. Serverless Framework Plugin: serverless-iam-roles-per-function
Ensuring least privilege permissions for Lambda functions requires ensuring it’s easy for developers to specify a minimum set of IAM permissions for each function. The serverless-iam-roles-per-function allows per function IAM permissions to be specified with ease.
For more on the impact of least privilege see: Serverless-Transformation Lambda Security Checklist
“ The stylish Node.js middleware engine for AWS Lambda”
Middy allows you to use the middleware pattern to avoid polluting your Lambda handler functions with common technical steps — keeping them as clean business logic.
If you’re using Node.js and Lambda, Middy is a must-have!
3. Serverless Framework Plugin: serverless-step-functions
AWS Step Functions are great for managing workflows in a Serverless application via the Finite State Machine model. However, they are fairly verbose to write in pure Cloudformation. Luckily the serverless-step-functions plugin to the Serverless framework makes your life a lot easier!
4. Serverless Dev Tools: sls-dev-tools
sls-dev-tools provides a complete dashboard & toolset for Serverless Application Development, all inside your terminal — no more jumping to the AWS console.
Think Chrome DevTools, but for the Serverless world.
- 💻Rapid In-Terminal Feedback (no more jumping to the AWS Console)
- 📊Targeted metrics to empower you to build fast and efficient applications
- ⌨️ Powerful keybindings to deploy, inject, open and manipulate stack resources without the clicks
- 🛠Works with any IaC, from the Serverless Framework to SAM
The Developer Tools for the Serverless World - think Chrome Dev Tools but for Serverless.
5. Amplify Library
Amplify is a great project, and does many things. It’s a Library to easily connect to Cloud services, a CLI Tool and a set of UI Components.
All are interesting in their own right, yet it’s the Library that is super useful to most full-stack Serverless projects.
Regardless of the Infrastructure as Code tool used (Serverless, Amplify, CDK, SAM, Cloudformation…), the Library can hook into your stack via manual configuration and make the frontend development a breeze.
When the Amplify CLI is used to create resources the Amplify Library Configure looks something like this:
Yet, not all projects use Amplify to manage their resources. So manual configuration can be done as follows:
This example for Amazon Cognito authentication shows that with just 4 attributes the library can hook into your existing stack resources. Then something like phone number verification becomes as simple as:
Amplify supports the following services and more:
- Data Store
- Predictions (AI/ML)
I don’t suggest all projects can use amplify to manage their resources, but most can use its powerful library to interact with resources created by another tool (e.g. the Serverless Framework).