The Twelve Days of AWS: Serverless

12 Days of AWS Day 3 written around snowflakes with a penguin wearing a winter sweater

While this is not an actual AWS tool, it is something so useful for setting up Lambdas that it deserves a day to itself.

When looking for how to get started with Lambdas I ran into Serverless pretty quickly. It’s a framework that does a lot of the nitty-gritty and heavy lifting involved with configuring the elements that surround the code written inside the Lambdas.

To start with, you modify a YAML file which defines all of the Lambda config, from what user can do what, to what events trigger what, and everything in between. 

A lot of this config can be left as default, and then modified as seen fit later on.

Once some code is written that is destined to be run inside the Lambda, you can invoke this code locally for testing, and then with another command, deploy the code to your AWS environment.

The framework will also set up things that I didn’t even notice at first, like logging groups in Cloudwatch, code stacks in CloudFormation, and user permissions in IAM (I will be covering all 3 of those in upcoming days).

Obviously local environments won’t match the Amazon Linux that Lambdas run on, so there is even the option to have Serverless deploy locally to a Docker container running Amazon Linux, from where it can compile packages, test code, and get things ready before pushing up to AWS.

If you want to get set up with a Lambda quickly to check it will work for you, this is the way to do it. Then once your solution works, you can spend more time understanding all the extra elements involved.