Serverless · Freelance

Serverless Video-on-Demand with MediaConvert, CloudFront and Cognito

Serverless Framework stack that transcodes uploads to HLS and MP4 with thumbnails and serves them through a Cognito-protected API and signed CloudFront URLs.

  • S3
  • Lambda
  • MediaConvert
  • EventBridge
  • DynamoDB
  • API Gateway
  • Cognito
  • CloudFront
  • Serverless Framework

// Overview

An upload triggers a Lambda that submits a MediaConvert job from a template (MP4, HLS ladder, thumbnails). A job-state event updates the video record in DynamoDB. A REST API (list, get, upload, edit, delete) is secured by two Cognito pools, one for all users and one for admins. Playback URLs are CloudFront-signed over a private origin.

// The problem

A managed pipeline to ingest, transcode, catalogue and securely stream videos with role-based access.

// Flow

Serverless Video-on-Demand with MediaConvert, CloudFront and Cognito flow1. Input bucket → 2. MediaConvert job → 3. Outputs → 4. Status events → 5. DynamoDB → 6. REST API → 7. Auth → 8. Delivery01Input bucket02MediaConvert job03Outputs04Status events05DynamoDB06REST API07 · GATEAuth08Delivery
  1. Input bucketupload event triggers the conversion Lambda
  2. MediaConvert jobsettings updated per object
  3. OutputsMP4, adaptive HLS and thumbnails
  4. Status eventsjob state change invokes a status Lambda
  5. DynamoDBmetadata and status, Ready on completion
  6. REST APIAPI Gateway and Lambda per endpoint
  7. Auth gatetwo Cognito pools, users versus admins
  8. DeliveryCloudFront with origin access to a private bucket, signed URLs

// Design decisions & guardrails

  • Separate admin and user pools for least privilege on write and delete.
  • Private origin bucket with signed URLs.
  • Per-function IAM roles and single-command deploy.

// Outcome

Upload to adaptive, access-controlled playback with no servers to run.

// Related