Serverless mp3 and mp4 to HLS converter using Zappa, AWS Lambda, API Gateway, S3 and FFmpeg : Update zappa_settings.json file

Update zappa_settings.json file

{
   "hls_dev": {
      "profile_name": "default", 
      "project_name": "hls-dev", 
      "s3_bucket": "zappa-hls-zip-bucket",
      "events": [{ 
         "function": "converter.convert_to_hls",
         "event_source": {
            "arn": "arn:aws:s3:::input-bucket", 
            "events": ["s3:ObjectCreated:*"]
         }
      }],
      "layers": ["<ffmpeg lambda layer ARN>"]
   }
}

Update the zappa_settings.json file created when we executed zappa init

profile_name is the default AWS IAM credentials that will be used to deploy and configure the lambda functions.

project_name is the name of the project as will be shown in AWS console.

The s3_bucket is where zappa will first upload your lambda code to before creating a lambda out of it. You can update project_name and s3_bucket as you desire.

The function defines the source file and the entry function. This must match the name of the main file containing our entry function (converter) and the entry function (convert_to_hls).

The event source defines the ARN of the S3 bucket and the event (which is the creation of an object in the bucket, i.e, s3:ObjectCreated:*)

Lastly, we need to tell zappa which lambda layer should be added to the lambda function. We specify the lambda layer created to store the fffmpeg command line interface.

For a complete reference of the zappa settings, see https://github.com/Miserlou/Zappa#advanced-settings


course logo
Serverless mp3 and mp4 to HLS converter using Zappa, AWS Lambda, API Gateway, S3 and FFmpeg
Number of sections:
7
Content length:
Delivery formats:

Instructor

Evans Boateng Owusu
Evans is a Computer Engineer and cloud technology enthusiast. He has a Masters degree in Embedded Systems (focusing on Software design) from the Technical University of Eindhoven (The Netherlands) and a Bachelor of Science in Electronic and Computer Engineering from the Polytechnic University of Turin (Italy). In addition, he has worked for the high-tech industry in the the Netherlands and other large corporations for over seven years.... Show more
Serverless mp3 and mp4 to HLS converter using Zappa, AWS Lambda, API Gateway, S3 and FFmpeg