chapter three

3 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, and AWS Elementals MediaConvert
  • Using Serverless Framework to organize and deploy functions

To give you a thorough understanding of serverless architectures, you’re going to build a serverless application. Specifically, you are going to build a video-sharing website, a YouTube clone, which we’ll call 24-Hour Video. Your application will consist of a website with user registration and authentication capabilities. Your users will be able to watch and upload videos. Videos uploaded to your website will be transcoded to different resolutions and bitrates. This will allow people from all over the world, and on different connections and devices to watch them. You’ll use a number of AWS services to build your application, including AWS Lambda, S3, MediaConvert, SNS, SQS, Cognito and DynamoDB. In this chapter, we’ll focus on building your serverless pipeline for transcoding uploaded videos.

3.1   24-Hour Video

Before we jump in to the nitty-gritty of the chapter, let’s step ahead and look at what you’re going to accomplish by the time you get to the final chapter. Figure 3.1 shows a 10,000-foot view of the major components you’re going to develop. These include a transcoding pipeline, a website, and a custom API. At the end, you’ll also have a full-fledged system with a database and a user system.

3.1.1   General requirements

3.1.2   Amazon Web Services

3.2   Preparing your system for Serverless

3.2.1   Setting up your system

3.2.2   Working with Identity and Access Management

3.2.3   Let’s make a bucket

3.2.4   Creating an IAM role

3.2.5   AWS Elementals MediaConvert

3.2.6   MediaConvert Role

3.3   Starting with the Serverless framework

3.3.1   Setting up Serverless framework

3.3.2   Bringing Serverless Framework to 24-Hour Video

3.3.3   Creating your first Lambda function

3.3.4   Testing in AWS

3.3.5   Looking at logs