Serverless easy ride

Olivier Butterbach
Jan 8 · 2 min read

It’s hard to believe that Lambda function have already been around only for the last 5 years (at the time of writing this), and it became so popular so quickly.

I’ve been working as a DevOps engineer for the last 8 years or so (working on AWS for the last 7 years), and I wanted to review some of the tools I came accross for deploying serverless solutions on AWS.


I. First wave: bash script

It works! And it still does, although it’s not very scalable, it’s mainly (as I still does today) for installing dependencies, testing and packaging them into zip.

One example of bash script code I keep re-using is this one:

This is working quite well for the first part (Continuous Integration) but doesn’t fit the second part (Continuous Delivery). Back in these days, I started using CloudFormation for CD requirements, let’s see an example.


II. Cloudformation Area

Around 2016, a Cloudformation allowed the use of Yaml format for declaring AWS resources, that was a massive change specially for the sake of my eyes

JSON Format

From this to this:

YAML Format

Declaring AWS Lambda functions for Operational purposes, Cloudformation was indeed doing the job. Unfortunately, it can become rather complexe if you start adding API Gateway / SNS Topics and so on to the equations:

#fml

This is a truncated example of an API Gateway declaration in Cloudformation format 😅. Let’s see Terraform way


III. Does Terraform make it better?

Depending who you ask, I believe it slightly does but not that much:

Based on my experience, I had trouble deploying AWS Lambda functions with Terraform, especially around Stages and Testings which would see later. Terraform seems to have issues picking up the latest zip file containing the source code (even when build locally), I had to ran it twice

Even built locally, the update wouldn’t reach AWS

IV. AWS SAM

Around 2018, AWS introduced AWS Serverless Application Model to answer the needs for managing Serverless deployments and the management of them. SAM is simply an extension of CloudFormation, is also using Yaml format and the installation process is as simple as AWS CLI one:

SAM CLI is then available as sam. Once completed, let’s crack on the first step: Package

This command is to upload any artifacts to an AWS S3 bucket.

V. Serverless Framework

More to come…

VI. What next?

More to come…

Olivier Butterbach

Written by

Cloud technologies and solutions lover, https://www.cdcloudlogix.com

More From Medium

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade