chapter two

2 First steps to serverless

 

This chapter covers

  • Creation of S3 buckets and Lambda functions
  • Writing and deploying Lambda functions
  • Using AWS services such as Simple Storage Service (S3), and AWS Elemental MediaConvert
  • Using Serverless Framework to organize and deploy functions

To give you an understanding of serverless architectures, you’re going to build a small, event-driven, serverless application. Specifically, you are going to build a video transcoding pipeline. You will be able to upload a video file to an S3 bucket and have it transcoded to different resolutions and bitrates. To build this video transcoding pipeline you are going to use AWS Lambda, S3, and AWS Elemental MediaConvert. Later, if you so desire, you can build a website around it, akin to YouTube, but we’ll leave it to you as an exercise. If you want to see how we’ve done it ourselves, you can refer to our first edition that covers the website in some detail.

2.1      Video Encoding Pipeline

At a high level, in this chapter, you are going to learn the following:

  • How to construct a rudimentary serverless architecture using three AWS services including Lambda.
  • How to use the Serverless Framework to organize and deploy a serverless application.
  • How to run, debug, and test the Serverless pipeline you have built in AWS.

2.1.1   Amazon Web Services

2.2      Preparing your system for Serverless

2.2.1   Setting up your system

2.2.2   Working with Identity and Access Management

2.2.3   Let’s make a bucket

2.2.4   Creating an IAM role

2.2.5   AWS Elemental MediaConvert

2.2.6   MediaConvert Role

2.3      Starting with the Serverless framework

2.3.1   Setting up Serverless framework

2.3.2   Bringing Serverless Framework to 24-Hour Video

2.3.3   Creating your first Lambda function

2.3.4   Testing in AWS

2.3.5   Looking at logs

2.4      Lessons learned