chapter two

2 First steps to serverless

 

This chapter covers

  • 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 services

To give you an understanding of serverless architectures, you’re going to build a small, event-driven, serverless application – specifically it is going to be a video transcoding pipeline. Your service will take videos uploaded to an S3 bucket and transcode them to different resolutions and bitrates (kind of like YouTube only without the front-end website). 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 front-end around it 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 frontend 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

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