Skip to main content
The AWS Lambda package runs HyperFrames’ distributed render primitives on AWS. It ships the Lambda handler, a Node client SDK, and an optional CDK construct for provisioning the render stack inside an adopter’s AWS account.

When to Use

Use @hyperframes/aws-lambda when you need to:
  • Render large compositions on AWS Lambda instead of one local machine
  • Fan out plan, renderChunk, and assemble through Step Functions
  • Store render inputs, intermediate chunks, and outputs in S3
  • Drive renders from CI, a backend service, or a custom CLI
  • Provision the render topology from a CDK app
Use a different package if you want to:
  • Render locally or inside your own Node process - use the CLI or producer
  • Run the same distributed model on Google Cloud - use gcp-cloud-run
  • Build or edit composition HTML - use studio, sdk, or core
This package is deployment glue for AWS infrastructure. It assumes you control an AWS account, S3 bucket, Step Functions state machine, and Lambda runtime configuration.

Package Exports

aws-cdk-lib and constructs are optional peer dependencies. SDK-only consumers do not need them unless they import from @hyperframes/aws-lambda/cdk.

Architecture

The Lambda adapter wraps the distributed producer primitives behind one dispatch boundary:
1

Plan

Fetches the project inputs from S3, probes the composition, prepares audio, and publishes the plan artifacts. Plan v2 defers eligible constant-frame-rate SDR video extraction to the chunk workers; variable-frame-rate sources and required HDR color conversions still run during planning.
2

Render chunks

Step Functions fans out chunk jobs. Each Lambda invocation downloads the assets it needs, extracts its deferred video frames, renders one chunk, and uploads the result.
3

Assemble

Downloads all rendered chunks plus audio assets, assembles the final output, and writes the finished file to S3.
All three phases must fit the configured per-invocation Lambda timeout, at most 15 minutes, and the function’s temporary storage. Smaller chunks can reduce each worker’s extraction and rendering work, but do not divide video extraction that still happens in Plan. See long-video planning limits for FFmpeg frame-stall timeouts and how to split jobs that cannot fit. The handler uses @sparticuz/chromium by default, with a build-time fallback for bundling chrome-headless-shell directly when needed.

Using the SDK

After deploying the AWS resources, use the SDK from Node:
Plan v2 is the only supported distributed plan transport. Workers fetch manifest-selected content-addressed artifacts, and the SDK sends explicit v2 without requiring a protocol option.
For an existing installation, pause new renders and drain active Step Functions executions. Redeploy the Lambda handler and SAM/CDK state machine from the same package version before upgrading the application SDK. Older infrastructure may lack the Plan v2-only request and locator contract.
renderToLambda() validates the distributed render config before starting the Step Functions execution, so invalid dimensions, formats, chunk sizes, or payload sizes fail synchronously.

Using the CDK Construct

Building the Handler ZIP

From the monorepo:
The build stages Chromium, Puppeteer, FFmpeg, and the handler bundle into packages/aws-lambda/dist/handler.zip. The size verifier keeps the unzipped artifact below Lambda’s deployment limit.

AWS Lambda Deployment

End-to-end deployment details and operational notes.

@hyperframes/producer

The distributed primitives that the Lambda handler executes.