12 Lambda-based serverless functions

 

This chapter covers

  • Implementing a CI/CD pipeline for a serverless-based application from scratch
  • Setting up continuous deployment and delivery with AWS Lambda
  • Separating multiple Lambda deployment environments
  • Implementing API Gateway multistage deployments with Lambda alias and stage variables
  • Delivering email notifications with attachments upon completion of CI/CD pipelines

In the previous chapters, you learned how to write a CI/CD pipeline for a containerized application running in both Docker Swarm and Kubernetes. In this chapter, you will learn how to deploy the same application written in a different architecture.

Serverless is the fastest-growing architectural movement right now. It allows developers to develop scalable applications faster by delegating the full responsibility of managing the underlying infrastructure to the cloud provider. That said, going serverless carries several key challenges, one of which is CI/CD.

12.1 Deploying a Lambda-based application

Multiple serverless providers are out there, but to keep it simple, we’ll use AWS—and specifically, AWS Lambda (https://aws.amazon.com/lambda/), which is the best known and most mature solution in the serverless space today. AWS Lambda, launched at AWS re:Invent 2014, was the first implementation of serverless computing. Users can upload their code to Lambda, which then performs operational and scaling activities on behalf of the users.

12.2 Creating deployment packages

12.2.1 Mono-repo strategy

12.2.2 Multi-repo strategy

12.3 Updating Lambda function code

12.4 Hosting a static website on S3

12.5 Maintaining multiple Lambda environments

12.6 Configuring email notification in Jenkins

Summary