Use AWS Fargate to Build a Serverless Video Processor

Hey folks, this is going to be a short post, to simply point to some video training that I’ve recently published. As a software instructor for CBT Nuggets, I produced a series of videos that describes how I am building a serverless solution to perform video processing tasks. In addition to the video training, I also released an open source git repository, on GitHub, containing the final solution. The solution uses AWS Fargate as the compute component, to perform a video transcoding job.

Now that you have the video training and code, check out the solution design. Here’s a snippet of the high-level architecture I used to put this solution together.

Architecture Diagram for Serverless AWS Fargate Solution

As you can see, there is no infrastructure to deploy as part of this solution. By using AWS Fargate, you avoid the need to provision virtual machines and maintain them over time. Instead, Fargate utilizes industry standard OCI containers to run tasks in the AWS cloud.

By using a few services together, such as S3 object storage, AWS CloudTrail, Amazon EventBridge, and AWS Step Functions, you can pass event data through a pipeline that doesn’t touch any customer-owned virtual machines. A major benefit of this solution is that it’s paid for on a consumption basis. If you’re not running video transcoding tasks, you’re not paying unnecessarily for compute time. The primary cost of this solution is the storage in Amazon S3 for the source and destination files.

Solution Deployment

Next up is deployment. The entire solution is deployed using AWS CloudFormation. Aside from CloudFormation, the only exception is that the container image is built and pushed through a separate deployment script. However, you can adapt this solution to use AWS CodeBuild to build and push the container image instead.

Both the CloudFormation deployment script and the container image build script use PowerShell. PowerShell is a cross-platform automation framework that makes it easy to prototype automation tasks and deploy production code.

Solution Security

One of the great things about using a serverless approach to build this video processor solution, is that you don’t have to worry about virtual machines infected with malware. While it’s technically possible for a container to become infected, this solution doesn’t have any network listeners on it. Also, the Fargate task is only making outbound API calls against trusted AWS APIs to the Amazon S3 service.

Because all AWS services are in use, there are no API keys or tokens to encrypt and store. Instead, IAM roles and policies control access between services.

Please feel free to share your comments and feedback about my video training, and the open source solution, on this post!

I have other articles on AWS related topics, so please feel free to check them out as well.