Deploy distributed HyperFrames rendering to AWS Lambda and drive renders from a laptop or CI.
HyperFrames ships a first-class AWS Lambda deployment: one Lambda function fronts a Step Functions standard workflow that fans renders out across many parallel chunk workers, with intermediate artifacts in S3. End-to-end is three commands once your AWS credentials are configured.
Templates with variables work on the same Lambda stack — declare data-composition-variables on the composition, then pass values per render with --variables or fan a whole batch out with lambda render-batch. See the Templates on Lambda guide for the personalised-render pipeline (single render, batch from JSONL, programmatic SDK) and the 256 KiB Step Functions execution-input cap.
┌──────────────────────────────────────────────────────────────────┐│ Step Functions state machine ││ Plan → Map(N) RenderChunk → Assemble │└──────────────────────────────────────────────────────────────────┘ │ dispatches by event.Action ▼┌──────────────────────────────────────────────────────────────────┐│ One Lambda function (packages/aws-lambda/dist/handler.zip) ││ handler.mjs ││ ├─ Action="plan" → @hyperframes/producer/distributed ││ ├─ Action="renderChunk" → @hyperframes/producer/distributed ││ └─ Action="assemble" → @hyperframes/producer/distributed ││ bin/ffmpeg — ffmpeg-static ││ node_modules/@sparticuz/chromium/ — Lambda-optimised Chromium │└──────────────────────────────────────────────────────────────────┘ │ pure functions over local paths ▼┌──────────────────────────────────────────────────────────────────┐│ S3 bucket — plan tarball + per-chunk outputs + final mp4 │└──────────────────────────────────────────────────────────────────┘
The Lambda handler is a thin dispatch: parse the Step Functions event, download inputs from S3 into /tmp, call the OSS primitive from @hyperframes/producer/distributed, upload outputs back, return a small JSON result. Everything heavy — capture, encode, audio mix — happens inside the OSS primitives.
The published CLI loads the AWS adapter only for Lambda commands. Each release pins a prebuilt Lambda handler ZIP (a GitHub release asset); lambda deploy downloads it, checks its SHA-256 and deploys it with the adapter’s SAM template. No repo checkout needed.
npm install -g @hyperframes/aws-lambda alongside the CLI, at the same version
HyperFrames repo checkout (optional)
Inside a checkout, or with HYPERFRAMES_REPO_ROOT pointing at one, lambda deploy builds the handler ZIP from source instead (needs bun). Use it to deploy unreleased changes, --chrome-source=chrome-headless-shell, or an adapter release older than the prebuilt handler. A checkout deploy on arm64 also needs the video image built from that checkout (HYPERFRAMES_LAMBDA_VIDEO_IMAGE), or --video-arch x86_64.
git clone https://github.com/heygen-com/hyperframes, and npm install -g bun or bun.sh
By default the stack reserves no concurrency. Each render reads the account’s
unreserved Lambda concurrency when it plans, and runs up to 90% of it at once
(at most 256 chunks), leaving the rest for other functions in the account. The
plan logs the number it chose. Pass --concurrency=N to reserve N executions
for the function instead; every render then runs at most N chunks at once.Upgrading: redeploying an existing stack without --concurrency keeps the
reservation it already has, and deploy prints it. Stacks deployed by earlier
CLI versions reserved 8 by default, so they stay at 8 until you pass
--concurrency=N. Pass --concurrency=none to remove the reservation so each
render sizes itself to the account.deploy records the stack’s bucket and state machine in .hyperframes/lambda-stack-<stack-name>.json under the current directory. Every other lambda command reads that file, so run them from the same directory with the same --stack-name, or they stop with “no stack state”. Redeploying to upgrade rewrites the same file.After deploy, render anything with:
The --wait flag blocks and streams per-chunk progress + accrued cost; drop it to fire-and-forget, then poll with hyperframes lambda progress <renderId> on your own cadence.See the CLI reference for full flag documentation.
Every lambda render call without --site-id hashes the project tree and checks each file against the bucket. For tight inner loops (CI smoke jobs, prompt iteration in a demo flow), pre-stage the project once and reuse the upload:
The siteId is content-addressed via a SHA-256 of the project tree. A site is a small sites/<siteId>/files.json that lists each file’s path and SHA-256. The files themselves live once per bucket under cas/sha256/, shared by every site and render, so a file another project already uploaded is never uploaded again. Pass the same --site-id to as many lambda render calls as you like.The stack’s bucket expires objects under cas/sha256/ 30 days after they were last written (the ExpireSharedContent lifecycle rule). Each render or sites create that reuses a file at least 7 days old rewrites it in place, so files in use never expire. If a site’s files did expire, lambda render --site-id re-uploads them from the project directory, if its copies still match. Otherwise, or when renderToLambda gets a siteHandle but no projectDir, the render stops with SITE_FILES_MISSING before starting; run sites create again to restore them.
lambda deploy now runs the plan and the render chunks on an arm64 container-image function by default; audio and assemble stay on the x86 function. Redeploying an existing stack without --video-arch moves it to arm64 and adds the <stack>-video ECR repository. To keep a stack on x86, pass --video-arch x86_64 on every deploy. --chrome-source chrome-headless-shell also needs --video-arch x86_64, because the arm64 image bundles sparticuz Chrome only.
Upgrading from a version before shared content storage
Redeploy the stack before upgrading the CLI or SDK that starts renders. A stack from an earlier version cannot read files.json sites. The CLI and renderToLambda check the state machine first and stop with STACK_TOO_OLD before uploading anything; run hyperframes lambda deploy (or redeploy your SAM template or CDK construct from the same version) and render again.
Existing site ids keep working. When sites/<siteId>/files.json is missing, the render uses that site’s project.tar.gz from the earlier version. If neither exists the render stops with SITE_NOT_FOUND, naming both keys; run sites create again.
Every project uploads once more. The site id scheme changed (it now also covers symlinked files), so sites create or the first lambda render of each project after the upgrade returns a new site id and uploads its files once.
If you want to read the CloudFormation before you deploy, or you need to customise the topology (extra alarms, SNS subscribers, KMS keys, …), invoke SAM directly against the template at examples/aws-lambda/template.yaml:
The template emits three CloudFormation outputs you’ll need to invoke renders:
RenderBucketName — S3 bucket for plan tarballs + per-chunk outputs + final renders.
RenderStateMachineArn — the Step Functions standard workflow that orchestrates Plan → Map → Assemble.
RenderFunctionArn — the single Lambda function the state machine dispatches against.
The SAM template’s default for ReservedConcurrency is -1 (unreserved), the same as the Path 1 CLI: each render runs up to 90% of the account’s unreserved concurrency. Set it to bound how many chunks run at once.
For users already running CDK, the @hyperframes/aws-lambda package exports a HyperframesRenderStack L2 construct that emits the same topology as the SAM template:
import { App, CfnOutput, Stack } from "aws-cdk-lib";import { HyperframesRenderStack } from "@hyperframes/aws-lambda/cdk";const app = new App();const stack = new Stack(app, "MyApp");const render = new HyperframesRenderStack(stack, "Render", { projectName: "hyperframes", lambdaMemoryMb: 10240, reservedConcurrency: 8, chromeSource: "sparticuz",});new CfnOutput(stack, "RenderBucketName", { value: render.bucket.bucketName });new CfnOutput(stack, "StateMachineArn", { value: render.stateMachine.stateMachineArn });
aws-cdk-lib and constructs are declared as optional peer dependencies of @hyperframes/aws-lambda, so consumers who only need the SDK don’t pay the CDK import cost.The construct exposes .bucket, .renderFunction, and .stateMachine so you can wire dashboards, SNS topics, or other AWS resources alongside it without re-deriving ARNs.
The CLI ships a built-in IAM bootstrap to avoid the “User is not authorized to perform iam:CreateRole” first-deploy trap:
# Print an inline policy doc to attach to the IAM user that runs the CLI.hyperframes lambda policies user# Print { TrustRelationship, InlinePolicy } for a CloudFormation service role.hyperframes lambda policies role# Validate a checked-in policy still covers the CLI's needs (exit non-zero on missing).hyperframes lambda policies validate ./infra/iam/hyperframes-deploy.json
Code that calls the SDK’s renderToLambda with its own role needs states:DescribeStateMachine on the state machine besides states:StartExecution and S3 read/write on the bucket: each render reads the definition to confirm the stack is new enough.The generated documents grant Resource: "*" for the CLI’s required action set. After your first successful deploy you can narrow Resource to the deployed ARNs — predictable per the CloudFormation outputs above. Adopters running the CLI in CI typically check the policy doc into source control and run policies validate as a pre-deploy step to catch drift.
Lambda renders are billed by GB-seconds (Lambda billed duration × configured memory) plus a tiny per-state-transition fee for Step Functions standard workflows. hyperframes lambda progress exposes the running tally:
The IAM credential running lambda deploy doesn’t have permission to create the service role CloudFormation needs. Run hyperframes lambda policies user and attach the printed policy to your IAM user (or take the policies role output and have your admin create a deploy role).
Step Functions invoked a renderChunk with a plan hash that didn’t match the planDir on S3. Almost always means the producer version differs between the local plan() build and the deployed Lambda ZIP. Re-run hyperframes lambda deploy (which rebuilds the ZIP) and re-render.
The handler launched Chromium but the runtime probe found a non-SwiftShader GL backend. Hardware GL is non-deterministic across chunk boundaries, so distributed renders refuse it at the runtime-image / launch-flags layer (not at the composition layer). Rebuild the handler ZIP and redeploy:
bun run --cwd packages/aws-lambda build:ziphyperframes lambda deploy --stack-name=<your-stack>
The build pipeline pins @sparticuz/chromium + the Chrome flags (--use-gl=swiftshader --use-angle=swiftshader) so a fresh deploy almost always resolves this. If it persists, your stack’s Lambda function is pointing at a stale handler ZIP from a previous deploy — lambda deploy always rebuilds, so re-running unsticks it.
Most often a Lambda cold-start chain on a many-chunk render. The Map state’s reserved concurrency caps how many chunks can run in parallel — if you set --concurrency=4 and your render has 16 chunks, the state machine processes them in batches of 4. hyperframes lambda progress <id> shows how many invocations are in flight.If progress doesn’t advance for >10 minutes, check the Step Functions execution in the AWS console — failed Lambda invocations include the typed error name (FONT_FETCH_FAILED, FFMPEG_VERSION_MISMATCH, etc.) which short-circuits the state machine.
Check the failed invocation’s CloudWatch logs to distinguish Plan from RenderChunk. In current versions, VIDEO_EXTRACTION_FAILED with ffmpeg_timeout means extraction stopped producing new frames for the configured interval, which defaults to 300,000 ms. Frame progress resets that timer, so an extraction can run for longer than five minutes while it keeps producing frames. Normal frame extraction splits long ranges into segments of up to two minutes, including variable-frame-rate sources.Plan v2 leaves eligible constant-frame-rate SDR extraction to chunk workers after a short timing probe. Variable-frame-rate sources and required HDR color conversions still extract during Plan; the deprecated v1 path also extracts videos during Plan. Smaller chunks or a higher maxParallelChunks can reduce each chunk’s work, but do not divide extraction that still happens during Plan.If the logs show that a slow extraction needs a longer gap between frames, and the work fits within the Lambda invocation budget, increase FFMPEG_PROCESS_TIMEOUT_MS on the deployed function that runs the failing phase. The default arm64 deployment uses the video function for Plan and RenderChunk. Setting the variable only in the terminal running lambda render does not configure the remote function. CDK users can configure the construct’s render function before deploying. Here, render is the HyperframesRenderStack instance created in the CDK example above:
This allows extraction to wait ten minutes without a new frame. Each Plan, RenderChunk, and Assemble invocation must still finish within its own configured Lambda timeout, at most 15 minutes, including downloads, processing, and uploads, and fit its /tmp storage. Measure the failing phase’s elapsed time and storage use in CloudWatch.If planning cannot fit, split the composition into shorter, frame-aligned projects, render each as a separate job, and combine the results. Choose part lengths from measured planning times. There is no fixed maximum video length: resolution, frame rate, codec, and Lambda resources affect extraction time.
The render bucket is created with CloudFormation Retain on delete — hyperframes lambda destroy (or sam delete) tears the function + state machine down but the bucket survives. This is intentional: it protects final-rendered MP4s from being lost when you re-deploy. To fully reclaim storage, empty + delete the bucket via the AWS console / aws s3 rb.A stack deployed on arm64 (the default) also has an ECR repository, <stack>-video, holding the video function’s image. hyperframes lambda destroy deletes it after the stack.
The stack was deployed by an earlier version that cannot read this version’s sites. Redeploy it (hyperframes lambda deploy), then render again. See Upgrading.
SITE_FILES_MISSING: some of the site’s files expired from cas/sha256/ after 30 days unused. Render from the project directory the site was created from, or run sites create again. SITE_NOT_FOUND: the bucket has no site under that id in either format; run sites create again and use the id it prints.
There is no completion webhook. Poll with hyperframes lambda progress or
watch the Step Functions execution.
There is no Lambda-specific composition-discovery verb. Point
lambda render at the project directory containing index.html.
Each --region is an independent stack. Cross-region failover is not built
in.
The distributed AWS path is SDR-only.
Plan v2 leaves eligible constant-frame-rate SDR video extraction to each
render chunk after a short timing probe. Each chunk extracts only the frames
it shows. On a 10,240 MB function, a 26-minute 576×1024 24 fps H.264 clip
plans in about 20 seconds. Each chunk reads only the byte ranges of each
video it shows, straight from the bucket. Variable-frame-rate sources and
required HDR color conversions still need extraction during Plan. Normal
frame extraction uses segments of up to two minutes, including variable-frame-rate
sources; FFMPEG_PROCESS_TIMEOUT_MS limits how long extraction can go without
producing a new frame. See long-video planning timeouts
for timeout configuration and splitting jobs that cannot fit.
Plan, each RenderChunk, and Assemble must finish within their own configured
Lambda timeout, at most 15 minutes, and fit the function’s /tmp storage.
For long renders, raise --max-parallel-chunks (maxParallelChunks in the SDK) so each chunk covers
fewer frames.
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"HyperFrames","colors":{"primary":"#181716","light":"#3CE6AC","dark":"#181716"},"logo":{"light":"/logo/light.svg","dark":"/logo/dark.svg","href":"https://hyperframes.heygen.com/"},"favicon":"/favicon.svg","appearance":{"default":"system"},"background":{"color":{"light":"#f2f0ed","dark":"#201e1c"}},"navbar":{"links":[{"href":"https://github.com/heygen-com/hyperframes","type":"github"},{"href":"https://discord.gg/7uMDe3PwQn","type":"discord"}],"primary":{"type":"button","label":"Download","href":"https://hyperframes.studio/studio/download?src=docs-navbar"}},"footer":{"socials":{"github":"https://github.com/heygen-com/hyperframes","discord":"https://discord.gg/7uMDe3PwQn","x":"https://x.com/HyperFrames_"},"links":[{"header":"Explore","items":[{"label":"Introduction","href":"/introduction"},{"label":"Make your first video","href":"/quickstart"},{"label":"Examples","href":"/examples"}]},{"header":"Build","items":[{"label":"Browser editor","href":"/studio"},{"label":"Catalog","href":"/catalog"},{"label":"Developers","href":"/developers/overview"}]},{"header":"Resources","items":[{"label":"Product updates","href":"/product-updates"},{"label":"Download the app","href":"https://hyperframes.studio/studio/download?src=docs-footer"},{"label":"GitHub","href":"https://github.com/heygen-com/hyperframes"}]},{"header":"Made by HeyGen","items":[{"label":"heygen.com","href":"https://www.heygen.com"}]}]},"fonts":{"family":"Inter"},"integrations":{"posthog":{"apiKey":"phc_zjjbX0PnWxERXrMHhkEJWj9A9BhGVLRReICgsfTMmpx","sessionRecording":false}},"contextual":{"options":["copy","claude","cursor","vscode","windsurf","mcp",{"title":"Open an issue","description":"Report a bug or request a feature","icon":"github","href":"https://github.com/heygen-com/hyperframes/issues/new"}],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"hasAudioNarration":false,"customDomains":[],"gitSource":{"type":"github","owner":"local","repo":"local","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"local","isBase":true},"buildId":"local","clientVersion":"0.0.4114"},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false,"isLoggedInCli":false},"customCss":[{"filePath":"catalog-gallery.css","content":".hfc-gallery{color:var(--hf-text);font-family:inherit}.hfc-gallery *{box-sizing:border-box}.hfc-gallery :is(button,a):focus-visible{outline:2px solid var(--hf-brand);outline-offset:4px}.hfc-gallery button{font:inherit;cursor:pointer}.hfc-gallery .hfc-hero h1{line-height:1.08;font-weight:600;letter-spacing:-.045em;margin:0 0 24px;color:var(--hf-heading)}.hfc-gallery .hfc-hero>p{font-size:15px;line-height:1.7;color:var(--hf-text-secondary);max-width:560px;margin:0}.hfc-gallery .hfc-overview{display:flex;flex-direction:column;gap:44px}.hfc-gallery .hfc-section-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:20px}.hfc-gallery .hfc-section-head h2{display:flex;align-items:center;gap:12px;font-size:20px;line-height:1.3;font-weight:600;margin:0;color:var(--hf-heading)}.hfc-gallery .hfc-section-head button{display:flex;align-items:center;justify-content:center;gap:6px;min-height:44px;min-width:44px;border:0;background:transparent;color:var(--hf-text-secondary);padding:6px 0 6px 8px;font-size:12px;white-space:nowrap}.hfc-gallery .hfc-caret{flex-shrink:0;transition:transform .16s ease}.hfc-gallery .hfc-section-head button[aria-expanded=\"true\"] .hfc-caret{transform:rotate(180deg)}.hfc-gallery .hfc-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:30px 20px}.hfc-gallery a.hfc-card,.hfc-gallery a.hfc-card:hover{display:block;min-width:0;text-decoration:none;color:inherit;border:0;background:transparent;box-shadow:none;transform:none}.hfc-gallery .hfc-media{position:relative;aspect-ratio:16/9;isolation:isolate;overflow:hidden;border-radius:12px;background:#101214}.hfc-gallery .hfc-media :is(img,video){position:absolute;inset:0;width:100%;height:100%;object-fit:cover;margin:0;border:0;border-radius:0}.hfc-gallery .hfc-preview-host{position:absolute;inset:0;pointer-events:none;opacity:0}.hfc-gallery .hfc-preview-host[data-ready=\"true\"]{opacity:1}.hfc-gallery .hfc-fallback{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:24px;height:100%;text-align:center;color:#ccc;background:#141414}.hfc-gallery .hfc-fallback span{color:#999;font-size:10px}.hfc-gallery .hfc-fallback strong{font-size:18px;line-height:1.2}.hfc-gallery .hfc-unsupported{gap:6px;padding:20px}.hfc-gallery .hfc-unsupported span{font-size:11px}.hfc-gallery .hfc-unsupported code{font-size:11px;padding:2px 6px;border-radius:6px;background:#0006;color:#ccc}.hfc-gallery .hfc-card-body{padding:12px 2px 0}.hfc-gallery .hfc-card-title{display:flex;align-items:start;justify-content:space-between;gap:10px}.hfc-gallery .hfc-card-title h3{font-size:15px;font-weight:500;line-height:1.4;margin:0;color:var(--hf-heading)}.hfc-gallery .hfc-status{flex-shrink:0;padding:2px 7px;border-radius:20px;background:var(--hf-brand-soft);color:var(--hf-brand);font-size:11px}.hfc-gallery .hfc-meta{font-size:12px;line-height:1.5;margin:4px 0 0;color:var(--hf-text-secondary)}.hfc-gallery .hfc-empty{padding:44px 20px;text-align:center}.hfc-gallery .hfc-empty h3{font-size:18px}.hfc-gallery .hfc-empty p{color:var(--hf-text-secondary);font-size:13px}.hfc-gallery .hfc-empty button,.hfc-gallery .hfc-load{padding:10px 16px;border:1px solid var(--hf-border-color);border-radius:8px;color:var(--hf-text);background:var(--hf-background-light);font-size:12px}.hfc-gallery .hfc-load{display:block;margin:24px auto 0}#navigation-items:has(a[href=\"/catalog\"]) .sidebar-group-header{display:none}#navigation-items .sidebar-group>li>a[href=\"/catalog\"]{width:100%;margin-left:0;padding:6px 12px;border:0;border-radius:12px}#navigation-items .sidebar-group>li[data-active=\"true\"]>a[href=\"/catalog\"],#navigation-items .sidebar-group>li[data-active-nav-item=\"true\"]>a[href=\"/catalog\"],#navigation-items .sidebar-group>li>a[href=\"/catalog\"][aria-current=\"page\"]{color:var(--hf-brand);background:color-mix(in oklab,var(--hf-brand) 10%,transparent)!important}@media (max-width:1100px) and (min-width:601px){.hfc-gallery .hfc-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width:600px){.hfc-gallery .hfc-grid{grid-template-columns:minmax(0,1fr)}.hfc-gallery .hfc-card-title h3{font-size:16px}}@media (prefers-reduced-motion:reduce){.hfc-gallery *{transition:none!important}}#navigation-items a[href^=\"/catalog/\"][aria-current=\"page\"]{color:var(--hf-brand);background:color-mix(in oklab,var(--hf-brand) 10%,transparent)!important}#navigation-items li[data-group-tag]{--catalog-desc:\"\"}#navigation-items li[data-group-tag]::after{content:var(--catalog-desc);display:block;padding:0 12px 8px 40px;font-size:11px;line-height:1.5;color:var(--hf-text-secondary)}#navigation-items li[data-title=\"3D\"][data-group-tag]{--catalog-desc:\"Three.js scenes and objects: camera moves, product turntables, glass, exploded layers.\"}#navigation-items li[data-title=\"Carousels\"][data-group-tag]{--catalog-desc:\"Image cards that circle, orbit, or sweep a path across the frame.\"}#navigation-items li[data-title=\"Text \u0026 captions\"][data-group-tag]{--catalog-desc:\"Word-by-word caption reveals, highlights, and kinetic type.\"}#navigation-items li[data-title=\"Code\"][data-group-tag]{--catalog-desc:\"Code snippets that type, diff, highlight, and morph on screen.\"}#navigation-items li[data-title=\"Transitions\"][data-group-tag]{--catalog-desc:\"Cuts between shots: zooms, warps, glitches, light leaks.\"}#navigation-items li[data-title=\"Data \u0026 charts\"][data-group-tag]{--catalog-desc:\"Bar, line, and progress charts that animate their own data in.\"}#navigation-items li[data-title=\"Scenes \u0026 demos\"][data-group-tag]{--catalog-desc:\"Full scenes: app showcases, chat exchanges, product demos.\"}#navigation-items li[data-title=\"Cursors\"][data-group-tag]{--catalog-desc:\"Pointers that glide, click, drag, select, and steer the eye across a UI.\"}#navigation-items li[data-title=\"Motion \u0026 effects\"][data-group-tag]{--catalog-desc:\"General-purpose motion: hovers, pops, blurs, grids, paths.\"}#navigation-items li[data-title=\"Surfaces\"][data-group-tag]{--catalog-desc:\"Background textures and screen treatments: grain, halftone, glass.\"}#navigation-items li[data-title=\"Blocks\"][data-group-tag]{--catalog-desc:\"Flowcharts, sketched frames, speech bubbles, and outro cards.\"}.hfc-gallery .mw{display:inline-block;position:relative;white-space:nowrap;--phase: 0;--period: 6;--bl: .87em}.hfc-gallery .mw .ch{display:inline-block;position:relative;transform-origin:50% 70%;background-image:var(--grad);background-size:calc(var(--period) * 1em) 100%;background-position:calc((var(--phase) * var(--period) - var(--x, 0)) * 1em) 0;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent}.hfc-gallery .mw .bl{display:inline-block;width:0;height:0;vertical-align:baseline}.hfc-gallery .mw .dsvg{position:absolute;left:var(--dot-x, 50%);top:var(--dot-y, .16em);width:calc(var(--dot-d, .15em) * 5);height:calc(var(--dot-d, .15em) * 5);margin:calc(var(--dot-d, .15em) * -2.5) 0 0 calc(var(--dot-d, .15em) * -2.5);overflow:visible;pointer-events:none}.hfc-gallery .mw .sq{position:absolute;display:block;left:0;top:calc(var(--bl) + .05em);width:100%;height:auto;overflow:visible;pointer-events:none}.hfc-gallery{padding:0 32px;max-width:1400px;margin:0 auto 48px}.hfc-gallery .hfc-hero{padding:48px 0}.hfc-gallery .hfc-hero h1{max-width:800px;font-size:clamp(34px,4vw,54px)}.hfc-gallery .mw .dsvg{left:50%;top:.18em;width:.75em;height:.75em;margin:-.375em 0 0 -.375em}.hfc-gallery .mw .sq{top:.94em}.hfc-gallery .mw .ring{transform-origin:0 0}.hfc-gallery .mw .sq path{stroke-dasharray:220;stroke-dashoffset:220}@media (prefers-reduced-motion:reduce){.hfc-gallery .mw .sq path{stroke-dashoffset:0}}@media (max-width:600px){.hfc-gallery{padding:0 18px}.hfc-gallery .hfc-hero{padding:28px 0}}.hfc-search{display:block;width:min(560px, 100%);margin-top:18px;padding:12px 16px;border:1px solid color-mix(in srgb, currentColor 18%, transparent);border-radius:999px;background:color-mix(in srgb, currentColor 4%, transparent);color:inherit;font:inherit;font-size:15px}.hfc-search:focus-visible{outline:2px solid color-mix(in srgb, currentColor 40%, transparent);outline-offset:2px}.hfc-gallery .hfc-pause{margin-top:14px;padding:7px 14px;border:1px solid color-mix(in srgb, currentColor 22%, transparent);border-radius:999px;background:transparent;color:inherit;font:inherit;font-size:13px;cursor:pointer}.hfc-gallery .hfc-pause:focus-visible{outline:2px solid color-mix(in srgb, currentColor 45%, transparent);outline-offset:2px}"},{"filePath":"custom.css","href":"/_mintlify/custom/docs.lltai.cloud/90bb600fca48615f/custom.css"},{"filePath":"template-gallery.css","content":".tpl-card video{width:100%;aspect-ratio:16/9;object-fit:cover;display:block}.tpl-card.portrait video{aspect-ratio:9/16}.tpl-card:hover{transform:translateY(-2px);border-color:var(--hf-border-color-light, #d0cfcb)}.tpl-label{position:absolute;bottom:0;left:0;right:0;padding:2.5rem 0.75rem 0.75rem;background:linear-gradient(transparent, rgba(0,0,0,0.75));pointer-events:none}"}],"page":{"pagePath":"deploy/aws-lambda","slug":"/deploy/aws-lambda","pageMetadata":{"title":"AWS Lambda","description":"Deploy distributed HyperFrames rendering to AWS Lambda and drive renders from a laptop or CI.","href":"/deploy/aws-lambda"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Deploy distributed HyperFrames rendering to AWS Lambda and drive renders from a laptop or CI.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`HyperFrames ships a first-class AWS Lambda deployment: one Lambda function fronts a Step Functions standard workflow that fans renders out across many parallel chunk workers, with intermediate artifacts in S3. End-to-end is three commands once your AWS credentials are configured.`}),`\n`,_jsx(CodeBlock,{numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`hyperframes`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` lambda`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` deploy`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`hyperframes`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` lambda`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` render`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ./my-project`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --width`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1920`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --height`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1080`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --wait`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`hyperframes`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` lambda`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` destroy`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Templates with `,_jsx(_components.a,{href:`/concepts/variables`,children:`variables`}),` work on the same Lambda stack — declare `,_jsx(_components.code,{children:`data-composition-variables`}),` on the composition, then pass values per render with `,_jsx(_components.code,{children:`--variables`}),` or fan a whole batch out with `,_jsx(_components.code,{children:`lambda render-batch`}),`. See the `,_jsx(_components.a,{href:`/deploy/templates-on-lambda`,children:`Templates on Lambda`}),` guide for the personalised-render pipeline (single render, batch from JSONL, programmatic SDK) and the 256 KiB Step Functions execution-input cap.`]}),`\n`,_jsx(Heading,{level:`2`,id:`architecture`,children:`Architecture`}),`\n`,_jsx(CodeBlock,{numberOfLines:`21`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`21`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`┌──────────────────────────────────────────────────────────────────┐`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ Step Functions state machine │`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ Plan → Map(N) RenderChunk → Assemble │`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`└──────────────────────────────────────────────────────────────────┘`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` │ dispatches by event.Action`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` ▼`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`┌──────────────────────────────────────────────────────────────────┐`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ One Lambda function (packages/aws-lambda/dist/handler.zip) │`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ handler.mjs │`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ ├─ Action=\"plan\" → @hyperframes/producer/distributed │`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ ├─ Action=\"renderChunk\" → @hyperframes/producer/distributed │`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ └─ Action=\"assemble\" → @hyperframes/producer/distributed │`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ bin/ffmpeg — ffmpeg-static │`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ node_modules/@sparticuz/chromium/ — Lambda-optimised Chromium │`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`└──────────────────────────────────────────────────────────────────┘`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` │ pure functions over local paths`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` ▼`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`┌──────────────────────────────────────────────────────────────────┐`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ S3 bucket — plan tarball + per-chunk outputs + final mp4 │`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`└──────────────────────────────────────────────────────────────────┘`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`The Lambda handler is a thin dispatch: parse the Step Functions event, download inputs from S3 into `,_jsx(_components.code,{children:`/tmp`}),`, call the OSS primitive from `,_jsx(_components.code,{children:`@hyperframes/producer/distributed`}),`, upload outputs back, return a small JSON result. Everything heavy — capture, encode, audio mix — happens inside the OSS primitives.`]}),`\n`,_jsx(Heading,{level:`2`,id:`prerequisites`,children:`Prerequisites`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Tool`}),_jsx(_components.th,{children:`Why`}),_jsx(_components.th,{children:`Install`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`AWS credentials`}),_jsx(_components.td,{children:`The CLI and the deploy step both call AWS APIs.`}),_jsxs(_components.td,{children:[`Env vars, `,_jsx(_components.code,{children:`~/.aws/credentials`}),`, SSO, or IMDS — any chain the AWS SDK for JavaScript v3 would resolve.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`AWS SAM CLI`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`hyperframes lambda deploy/destroy`}),` shells out to `,_jsx(_components.code,{children:`sam deploy`}),`/`,_jsx(_components.code,{children:`sam delete`}),`.`]}),_jsx(_components.td,{children:_jsx(_components.a,{href:`https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html`,children:`Install guide`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Lambda adapter`}),_jsxs(_components.td,{children:[`The published CLI loads the AWS adapter only for Lambda commands. Each release pins a prebuilt Lambda handler ZIP (a GitHub release asset); `,_jsx(_components.code,{children:`lambda deploy`}),` downloads it, checks its SHA-256 and deploys it with the adapter’s SAM template. No repo checkout needed.`]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`npm install -g @hyperframes/aws-lambda`}),` alongside the CLI, at the same version`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`HyperFrames repo checkout (optional)`}),_jsxs(_components.td,{children:[`Inside a checkout, or with `,_jsx(_components.code,{children:`HYPERFRAMES_REPO_ROOT`}),` pointing at one, `,_jsx(_components.code,{children:`lambda deploy`}),` builds the handler ZIP from source instead (needs `,_jsx(_components.code,{children:`bun`}),`). Use it to deploy unreleased changes, `,_jsx(_components.code,{children:`--chrome-source=chrome-headless-shell`}),`, or an adapter release older than the prebuilt handler. A checkout deploy on arm64 also needs the video image built from that checkout (`,_jsx(_components.code,{children:`HYPERFRAMES_LAMBDA_VIDEO_IMAGE`}),`), or `,_jsx(_components.code,{children:`--video-arch x86_64`}),`.`]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`git clone https://github.com/heygen-com/hyperframes`}),`, and `,_jsx(_components.code,{children:`npm install -g bun`}),` or `,_jsx(_components.a,{href:`https://bun.sh`,children:`bun.sh`})]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`three-deployment-paths`,children:`Three deployment paths`}),`\n`,_jsxs(Heading,{level:`3`,id:`path-1-—-hyperframes-lambda-cli-recommended`,children:[`Path 1 — `,_jsx(_components.code,{children:`hyperframes lambda`}),` CLI (recommended)`]}),`\n`,_jsxs(_components.p,{children:[`The CLI is a thin wrapper around the SAM template + the `,_jsx(_components.code,{children:`@hyperframes/aws-lambda`}),` SDK. For most adopters this is the right starting point.`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`hyperframes`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` lambda`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` deploy`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --stack-name=hyperframes-prod`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --region=us-east-1`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --memory=10240`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`By default the stack reserves no concurrency. Each render reads the account’s\nunreserved Lambda concurrency when it plans, and runs up to 90% of it at once\n(at most 256 chunks), leaving the rest for other functions in the account. The\nplan logs the number it chose. Pass `,_jsx(_components.code,{children:`--concurrency=N`}),` to reserve `,_jsx(_components.code,{children:`N`}),` executions\nfor the function instead; every render then runs at most `,_jsx(_components.code,{children:`N`}),` chunks at once.`]}),`\n`,_jsxs(_components.p,{children:[`Upgrading: redeploying an existing stack without `,_jsx(_components.code,{children:`--concurrency`}),` keeps the\nreservation it already has, and `,_jsx(_components.code,{children:`deploy`}),` prints it. Stacks deployed by earlier\nCLI versions reserved 8 by default, so they stay at 8 until you pass\n`,_jsx(_components.code,{children:`--concurrency=N`}),`. Pass `,_jsx(_components.code,{children:`--concurrency=none`}),` to remove the reservation so each\nrender sizes itself to the account.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`deploy`}),` records the stack’s bucket and state machine in `,_jsx(_components.code,{children:`.hyperframes/lambda-stack-\u003cstack-name>.json`}),` under the current directory. Every other `,_jsx(_components.code,{children:`lambda`}),` command reads that file, so run them from the same directory with the same `,_jsx(_components.code,{children:`--stack-name`}),`, or they stop with “no stack state”. Redeploying to upgrade rewrites the same file.`]}),`\n`,_jsxs(_components.p,{children:[`After `,_jsx(_components.code,{children:`deploy`}),`, render anything with:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`hyperframes`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` lambda`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` render`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ./my-project`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --width`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1920`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --height`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1080`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --wait`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`--wait`}),` flag blocks and streams per-chunk progress + accrued cost; drop it to fire-and-forget, then poll with `,_jsx(_components.code,{children:`hyperframes lambda progress \u003crenderId>`}),` on your own cadence.`]}),`\n`,_jsxs(_components.p,{children:[`See the `,_jsx(_components.a,{href:`/packages/cli#hyperframes-lambda`,children:`CLI reference`}),` for full flag documentation.`]}),`\n`,_jsxs(Heading,{level:`4`,id:`pre-staging-a-project-with-sites-create`,children:[`Pre-staging a project with `,_jsx(_components.code,{children:`sites create`})]}),`\n`,_jsxs(_components.p,{children:[`Every `,_jsx(_components.code,{children:`lambda render`}),` call without `,_jsx(_components.code,{children:`--site-id`}),` hashes the project tree and checks each file against the bucket. For tight inner loops (CI smoke jobs, prompt iteration in a demo flow), pre-stage the project once and reuse the upload:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`5`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`hyperframes`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` lambda`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` sites`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` create`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ./my-project`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# → Site ID: a1b2c3d4e5f6g7h8 (content-addressed)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`hyperframes`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` lambda`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` render`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ./my-project`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --site-id=a1b2c3d4e5f6g7h8`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --width`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1920`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --height`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1080`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --wait`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`siteId`}),` is content-addressed via a SHA-256 of the project tree. A site is a small `,_jsx(_components.code,{children:`sites/\u003csiteId>/files.json`}),` that lists each file’s path and SHA-256. The files themselves live once per bucket under `,_jsx(_components.code,{children:`cas/sha256/`}),`, shared by every site and render, so a file another project already uploaded is never uploaded again. Pass the same `,_jsx(_components.code,{children:`--site-id`}),` to as many `,_jsx(_components.code,{children:`lambda render`}),` calls as you like.`]}),`\n`,_jsxs(_components.p,{children:[`The stack’s bucket expires objects under `,_jsx(_components.code,{children:`cas/sha256/`}),` 30 days after they were last written (the `,_jsx(_components.code,{children:`ExpireSharedContent`}),` lifecycle rule). Each render or `,_jsx(_components.code,{children:`sites create`}),` that reuses a file at least 7 days old rewrites it in place, so files in use never expire. If a site’s files did expire, `,_jsx(_components.code,{children:`lambda render --site-id`}),` re-uploads them from the project directory, if its copies still match. Otherwise, or when `,_jsx(_components.code,{children:`renderToLambda`}),` gets a `,_jsx(_components.code,{children:`siteHandle`}),` but no `,_jsx(_components.code,{children:`projectDir`}),`, the render stops with `,_jsx(_components.code,{children:`SITE_FILES_MISSING`}),` before starting; run `,_jsx(_components.code,{children:`sites create`}),` again to restore them.`]}),`\n`,_jsx(Heading,{level:`4`,id:`upgrading-from-a-version-that-deployed-x86-only`,children:`Upgrading from a version that deployed x86 only`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`lambda deploy`}),` now runs the plan and the render chunks on an arm64 container-image function by default; audio and assemble stay on the x86 function. Redeploying an existing stack without `,_jsx(_components.code,{children:`--video-arch`}),` moves it to arm64 and adds the `,_jsx(_components.code,{children:`\u003cstack>-video`}),` ECR repository. To keep a stack on x86, pass `,_jsx(_components.code,{children:`--video-arch x86_64`}),` on every deploy. `,_jsx(_components.code,{children:`--chrome-source chrome-headless-shell`}),` also needs `,_jsx(_components.code,{children:`--video-arch x86_64`}),`, because the arm64 image bundles sparticuz Chrome only.`]}),`\n`,_jsx(Heading,{level:`4`,id:`upgrading-from-a-version-before-shared-content-storage`,children:`Upgrading from a version before shared content storage`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Redeploy the stack before upgrading the CLI or SDK that starts renders.`}),` A stack from an earlier version cannot read `,_jsx(_components.code,{children:`files.json`}),` sites. The CLI and `,_jsx(_components.code,{children:`renderToLambda`}),` check the state machine first and stop with `,_jsx(_components.code,{children:`STACK_TOO_OLD`}),` before uploading anything; run `,_jsx(_components.code,{children:`hyperframes lambda deploy`}),` (or redeploy your SAM template or CDK construct from the same version) and render again.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Existing site ids keep working.`}),` When `,_jsx(_components.code,{children:`sites/\u003csiteId>/files.json`}),` is missing, the render uses that site’s `,_jsx(_components.code,{children:`project.tar.gz`}),` from the earlier version. If neither exists the render stops with `,_jsx(_components.code,{children:`SITE_NOT_FOUND`}),`, naming both keys; run `,_jsx(_components.code,{children:`sites create`}),` again.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Every project uploads once more.`}),` The site id scheme changed (it now also covers symlinked files), so `,_jsx(_components.code,{children:`sites create`}),` or the first `,_jsx(_components.code,{children:`lambda render`}),` of each project after the upgrade returns a new site id and uploads its files once.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`path-2-—-direct-sam-deploy`,children:`Path 2 — Direct SAM deploy`}),`\n`,_jsxs(_components.p,{children:[`If you want to read the CloudFormation before you deploy, or you need to customise the topology (extra alarms, SNS subscribers, KMS keys, …), invoke SAM directly against the template at `,_jsx(_components.code,{children:`examples/aws-lambda/template.yaml`}),`:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`10`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`cd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` packages/aws-lambda`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bun`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` run`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` build:zip`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # produces dist/handler.zip`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`cd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ../../examples/aws-lambda`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`sam`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` deploy`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --stack-name=hyperframes-prod`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --region=us-east-1`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --resolve-s3`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --capabilities`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` CAPABILITY_IAM`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --no-confirm-changeset`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --parameter-overrides`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ChromeSource=sparticuz`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ReservedConcurrency=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`The template emits three CloudFormation outputs you’ll need to invoke renders:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`RenderBucketName`}),` — S3 bucket for plan tarballs + per-chunk outputs + final renders.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`RenderStateMachineArn`}),` — the Step Functions standard workflow that orchestrates Plan → Map → Assemble.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`RenderFunctionArn`}),` — the single Lambda function the state machine dispatches against.`]}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`The SAM template’s default for `,_jsx(_components.code,{children:`ReservedConcurrency`}),` is `,_jsx(_components.code,{children:`-1`}),` (unreserved), the same as the Path 1 CLI: each render runs up to 90% of the account’s unreserved concurrency. Set it to bound how many chunks run at once.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`path-3-—-cdk-construct`,children:`Path 3 — CDK construct`}),`\n`,_jsxs(_components.p,{children:[`For users already running CDK, the `,_jsx(_components.code,{children:`@hyperframes/aws-lambda`}),` package exports a `,_jsx(_components.code,{children:`HyperframesRenderStack`}),` L2 construct that emits the same topology as the SAM template:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`14`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`App`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`CfnOutput`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Stack`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"aws-cdk-lib\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`HyperframesRenderStack`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@hyperframes/aws-lambda/cdk\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` app`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` App`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` stack`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Stack`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`app`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"MyApp\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` render`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` HyperframesRenderStack`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`stack`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Render\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` projectName:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"hyperframes\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` lambdaMemoryMb:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 10240`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` reservedConcurrency:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 8`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` chromeSource:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"sparticuz\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` CfnOutput`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`stack`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"RenderBucketName\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`value:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` render`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`bucket`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`bucketName`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` CfnOutput`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`stack`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"StateMachineArn\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`value:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` render`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`stateMachine`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`stateMachineArn`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`aws-cdk-lib`}),` and `,_jsx(_components.code,{children:`constructs`}),` are declared as `,_jsx(_components.strong,{children:`optional peer dependencies`}),` of `,_jsx(_components.code,{children:`@hyperframes/aws-lambda`}),`, so consumers who only need the SDK don’t pay the CDK import cost.`]}),`\n`,_jsxs(_components.p,{children:[`The construct exposes `,_jsx(_components.code,{children:`.bucket`}),`, `,_jsx(_components.code,{children:`.renderFunction`}),`, and `,_jsx(_components.code,{children:`.stateMachine`}),` so you can wire dashboards, SNS topics, or other AWS resources alongside it without re-deriving ARNs.`]}),`\n`,_jsx(Heading,{level:`2`,id:`iam-permissions`,children:`IAM permissions`}),`\n`,_jsx(_components.p,{children:`The CLI ships a built-in IAM bootstrap to avoid the “User is not authorized to perform iam:CreateRole” first-deploy trap:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`8`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Print an inline policy doc to attach to the IAM user that runs the CLI.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`hyperframes`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` lambda`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` policies`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` user`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Print { TrustRelationship, InlinePolicy } for a CloudFormation service role.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`hyperframes`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` lambda`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` policies`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` role`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Validate a checked-in policy still covers the CLI's needs (exit non-zero on missing).`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`hyperframes`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` lambda`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` policies`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` validate`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ./infra/iam/hyperframes-deploy.json`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Code that calls the SDK’s `,_jsx(_components.code,{children:`renderToLambda`}),` with its own role needs `,_jsx(_components.code,{children:`states:DescribeStateMachine`}),` on the state machine besides `,_jsx(_components.code,{children:`states:StartExecution`}),` and S3 read/write on the bucket: each render reads the definition to confirm the stack is new enough.`]}),`\n`,_jsxs(_components.p,{children:[`The generated documents grant `,_jsx(_components.code,{children:`Resource: \"*\"`}),` for the CLI’s required action set. After your first successful deploy you can narrow `,_jsx(_components.code,{children:`Resource`}),` to the deployed ARNs — predictable per the CloudFormation outputs above. Adopters running the CLI in CI typically check the policy doc into source control and run `,_jsx(_components.code,{children:`policies validate`}),` as a pre-deploy step to catch drift.`]}),`\n`,_jsx(Heading,{level:`2`,id:`cost-shape`,children:`Cost shape`}),`\n`,_jsxs(_components.p,{children:[`Lambda renders are billed by GB-seconds (Lambda billed duration × configured memory) plus a tiny per-state-transition fee for Step Functions standard workflows. `,_jsx(_components.code,{children:`hyperframes lambda progress`}),` exposes the running tally:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`7`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`hyperframes`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` lambda`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` progress`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` my-render-id`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Status: SUCCEEDED`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Progress: 100%`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Frames: 480 / 480`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Lambdas: 5`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Cost: $0.0214 (Lambda $0.0210 + SFN $0.0004)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Output: s3://hyperframes-renders/.../output.mp4`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`The cost number is an estimate: Lambda duration comes from the handler result,\nand S3 transfer is not included. Use AWS billing data for actual spend.`}),`\n`,_jsx(Heading,{level:`2`,id:`troubleshooting`,children:`Troubleshooting`}),`\n`,_jsxs(Heading,{level:`3`,id:`sam-deploy-fails-with-“stack-already-exists”`,children:[_jsx(_components.code,{children:`sam deploy`}),` fails with “Stack already exists”`]}),`\n`,_jsxs(_components.p,{children:[`Pass the same `,_jsx(_components.code,{children:`--stack-name`}),` you used the first time. SAM is idempotent — re-running on an existing stack resolves to a no-op or an in-place update.`]}),`\n`,_jsx(Heading,{level:`3`,id:`user-is-not-authorized-to-perform-iamcreaterole`,children:_jsx(_components.code,{children:`User is not authorized to perform iam:CreateRole`})}),`\n`,_jsxs(_components.p,{children:[`The IAM credential running `,_jsx(_components.code,{children:`lambda deploy`}),` doesn’t have permission to create the service role CloudFormation needs. Run `,_jsx(_components.code,{children:`hyperframes lambda policies user`}),` and attach the printed policy to your IAM user (or take the `,_jsx(_components.code,{children:`policies role`}),` output and have your admin create a deploy role).`]}),`\n`,_jsx(Heading,{level:`3`,id:`lambda-function-failed-plan_hash_mismatch`,children:_jsx(_components.code,{children:`Lambda function failed: PLAN_HASH_MISMATCH`})}),`\n`,_jsxs(_components.p,{children:[`Step Functions invoked a `,_jsx(_components.code,{children:`renderChunk`}),` with a plan hash that didn’t match the planDir on S3. Almost always means the producer version differs between the local `,_jsx(_components.code,{children:`plan()`}),` build and the deployed Lambda ZIP. Re-run `,_jsx(_components.code,{children:`hyperframes lambda deploy`}),` (which rebuilds the ZIP) and re-render.`]}),`\n`,_jsx(Heading,{level:`3`,id:`lambda-function-failed-browser_gpu_not_software`,children:_jsx(_components.code,{children:`Lambda function failed: BROWSER_GPU_NOT_SOFTWARE`})}),`\n`,_jsx(_components.p,{children:`The handler launched Chromium but the runtime probe found a non-SwiftShader GL backend. Hardware GL is non-deterministic across chunk boundaries, so distributed renders refuse it at the runtime-image / launch-flags layer (not at the composition layer). Rebuild the handler ZIP and redeploy:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bun`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` run`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --cwd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` packages/aws-lambda`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` build:zip`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`hyperframes`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` lambda`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` deploy`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --stack-name=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`your-stack`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The build pipeline pins `,_jsx(_components.code,{children:`@sparticuz/chromium`}),` + the Chrome flags (`,_jsx(_components.code,{children:`--use-gl=swiftshader --use-angle=swiftshader`}),`) so a fresh deploy almost always resolves this. If it persists, your stack’s Lambda function is pointing at a stale handler ZIP from a previous deploy — `,_jsx(_components.code,{children:`lambda deploy`}),` always rebuilds, so re-running unsticks it.`]}),`\n`,_jsxs(Heading,{level:`3`,id:`render-seems-stuck-at-running`,children:[`Render seems stuck at `,_jsx(_components.code,{children:`RUNNING`})]}),`\n`,_jsxs(_components.p,{children:[`Most often a Lambda cold-start chain on a many-chunk render. The Map state’s reserved concurrency caps how many chunks can run in parallel — if you set `,_jsx(_components.code,{children:`--concurrency=4`}),` and your render has 16 chunks, the state machine processes them in batches of 4. `,_jsx(_components.code,{children:`hyperframes lambda progress \u003cid>`}),` shows how many invocations are in flight.`]}),`\n`,_jsxs(_components.p,{children:[`If progress doesn’t advance for >10 minutes, check the Step Functions execution in the AWS console — failed Lambda invocations include the typed error name (`,_jsx(_components.code,{children:`FONT_FETCH_FAILED`}),`, `,_jsx(_components.code,{children:`FFMPEG_VERSION_MISMATCH`}),`, etc.) which short-circuits the state machine.`]}),`\n`,_jsx(Heading,{level:`3`,id:`long-video-planning-times-out`,children:`Long-video planning times out`}),`\n`,_jsxs(_components.p,{children:[`Check the failed invocation’s CloudWatch logs to distinguish Plan from RenderChunk. In current versions, `,_jsx(_components.code,{children:`VIDEO_EXTRACTION_FAILED`}),` with `,_jsx(_components.code,{children:`ffmpeg_timeout`}),` means extraction stopped producing new frames for the configured interval, which defaults to 300,000 ms. Frame progress resets that timer, so an extraction can run for longer than five minutes while it keeps producing frames. Normal frame extraction splits long ranges into segments of up to two minutes, including variable-frame-rate sources.`]}),`\n`,_jsxs(_components.p,{children:[`Plan v2 leaves eligible constant-frame-rate SDR extraction to chunk workers after a short timing probe. Variable-frame-rate sources and required HDR color conversions still extract during Plan; the deprecated v1 path also extracts videos during Plan. Smaller chunks or a higher `,_jsx(_components.code,{children:`maxParallelChunks`}),` can reduce each chunk’s work, but do not divide extraction that still happens during Plan.`]}),`\n`,_jsxs(_components.p,{children:[`If the logs show that a slow extraction needs a longer gap between frames, and the work fits within the Lambda invocation budget, increase `,_jsx(_components.code,{children:`FFMPEG_PROCESS_TIMEOUT_MS`}),` on the deployed function that runs the failing phase. The default arm64 deployment uses the video function for Plan and RenderChunk. Setting the variable only in the terminal running `,_jsx(_components.code,{children:`lambda render`}),` does not configure the remote function. CDK users can configure the construct’s render function before deploying. Here, `,_jsx(_components.code,{children:`render`}),` is the `,_jsx(_components.code,{children:`HyperframesRenderStack`}),` instance created in the CDK example above:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`1`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`render`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`renderFunction`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`addEnvironment`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"FFMPEG_PROCESS_TIMEOUT_MS\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"600000\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`This allows extraction to wait ten minutes without a new frame. Each Plan, RenderChunk, and Assemble invocation must still finish within its own configured Lambda timeout, at most 15 minutes, including downloads, processing, and uploads, and fit its `,_jsx(_components.code,{children:`/tmp`}),` storage. Measure the failing phase’s elapsed time and storage use in CloudWatch.`]}),`\n`,_jsx(_components.p,{children:`If planning cannot fit, split the composition into shorter, frame-aligned projects, render each as a separate job, and combine the results. Choose part lengths from measured planning times. There is no fixed maximum video length: resolution, frame rate, codec, and Lambda resources affect extraction time.`}),`\n`,_jsx(Heading,{level:`3`,id:`tearing-down-doesn’t-reclaim-s3-storage`,children:`Tearing down doesn’t reclaim S3 storage`}),`\n`,_jsxs(_components.p,{children:[`The render bucket is created with CloudFormation `,_jsx(_components.code,{children:`Retain`}),` on delete — `,_jsx(_components.code,{children:`hyperframes lambda destroy`}),` (or `,_jsx(_components.code,{children:`sam delete`}),`) tears the function + state machine down but the bucket survives. This is intentional: it protects final-rendered MP4s from being lost when you re-deploy. To fully reclaim storage, empty + delete the bucket via the AWS console / `,_jsx(_components.code,{children:`aws s3 rb`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`A stack deployed on arm64 (the default) also has an ECR repository, `,_jsx(_components.code,{children:`\u003cstack>-video`}),`, holding the video function’s image. `,_jsx(_components.code,{children:`hyperframes lambda destroy`}),` deletes it after the stack.`]}),`\n`,_jsx(Heading,{level:`3`,id:`stack_too_old`,children:_jsx(_components.code,{children:`STACK_TOO_OLD`})}),`\n`,_jsxs(_components.p,{children:[`The stack was deployed by an earlier version that cannot read this version’s sites. Redeploy it (`,_jsx(_components.code,{children:`hyperframes lambda deploy`}),`), then render again. See `,_jsx(_components.a,{href:`#upgrading-from-a-version-before-shared-content-storage`,children:`Upgrading`}),`.`]}),`\n`,_jsxs(Heading,{level:`3`,id:`site_files_missing-or-site_not_found`,children:[_jsx(_components.code,{children:`SITE_FILES_MISSING`}),` or `,_jsx(_components.code,{children:`SITE_NOT_FOUND`})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`SITE_FILES_MISSING`}),`: some of the site’s files expired from `,_jsx(_components.code,{children:`cas/sha256/`}),` after 30 days unused. Render from the project directory the site was created from, or run `,_jsx(_components.code,{children:`sites create`}),` again. `,_jsx(_components.code,{children:`SITE_NOT_FOUND`}),`: the bucket has no site under that id in either format; run `,_jsx(_components.code,{children:`sites create`}),` again and use the id it prints.`]}),`\n`,_jsx(Heading,{level:`2`,id:`current-limits`,children:`Current limits`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`There is no completion webhook. Poll with `,_jsx(_components.code,{children:`hyperframes lambda progress`}),` or\nwatch the Step Functions execution.`]}),`\n`,_jsxs(_components.li,{children:[`There is no Lambda-specific composition-discovery verb. Point\n`,_jsx(_components.code,{children:`lambda render`}),` at the project directory containing `,_jsx(_components.code,{children:`index.html`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Each `,_jsx(_components.code,{children:`--region`}),` is an independent stack. Cross-region failover is not built\nin.`]}),`\n`,_jsx(_components.li,{children:`The distributed AWS path is SDR-only.`}),`\n`,_jsxs(_components.li,{children:[`Plan v2 leaves eligible constant-frame-rate SDR video extraction to each\nrender chunk after a short timing probe. Each chunk extracts only the frames\nit shows. On a 10,240 MB function, a 26-minute 576×1024 24 fps H.264 clip\nplans in about 20 seconds. Each chunk reads only the byte ranges of each\nvideo it shows, straight from the bucket. Variable-frame-rate sources and\nrequired HDR color conversions still need extraction during Plan. Normal\nframe extraction uses segments of up to two minutes, including variable-frame-rate\nsources; `,_jsx(_components.code,{children:`FFMPEG_PROCESS_TIMEOUT_MS`}),` limits how long extraction can go without\nproducing a new frame. See `,_jsx(_components.a,{href:`#long-video-planning-times-out`,children:`long-video planning timeouts`}),`\nfor timeout configuration and splitting jobs that cannot fit.`]}),`\n`,_jsxs(_components.li,{children:[`Plan, each RenderChunk, and Assemble must finish within their own configured\nLambda timeout, at most 15 minutes, and fit the function’s `,_jsx(_components.code,{children:`/tmp`}),` storage.\nFor long renders, raise `,_jsx(_components.code,{children:`--max-parallel-chunks`}),` (`,_jsx(_components.code,{children:`maxParallelChunks`}),` in the SDK) so each chunk covers\nfewer frames.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`related-topics`,children:`Related topics`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/deploy/templates-on-lambda`,children:`Render variable-driven templates on Lambda`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/packages/aws-lambda`,children:`Use the AWS Lambda package`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/deploy/overview`,children:`Choose another rendering path`})}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"AWS Lambda","description":"Deploy distributed HyperFrames rendering to AWS Lambda and drive renders from a laptop or CI.","href":"/deploy/aws-lambda"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Architecture","slug":"architecture","depth":2,"children":[]},{"title":"Prerequisites","slug":"prerequisites","depth":2,"children":[]},{"title":"Three deployment paths","slug":"three-deployment-paths","depth":2,"children":[{"title":"Path 1 — hyperframes lambda CLI (recommended)","slug":"path-1-—-hyperframes-lambda-cli-recommended","depth":3,"children":[]},{"title":"Pre-staging a project with sites create","slug":"pre-staging-a-project-with-sites-create","depth":4,"children":[]},{"title":"Upgrading from a version that deployed x86 only","slug":"upgrading-from-a-version-that-deployed-x86-only","depth":4,"children":[]},{"title":"Upgrading from a version before shared content storage","slug":"upgrading-from-a-version-before-shared-content-storage","depth":4,"children":[]},{"title":"Path 2 — Direct SAM deploy","slug":"path-2-—-direct-sam-deploy","depth":3,"children":[]},{"title":"Path 3 — CDK construct","slug":"path-3-—-cdk-construct","depth":3,"children":[]}]},{"title":"IAM permissions","slug":"iam-permissions","depth":2,"children":[]},{"title":"Cost shape","slug":"cost-shape","depth":2,"children":[]},{"title":"Troubleshooting","slug":"troubleshooting","depth":2,"children":[{"title":"sam deploy fails with “Stack already exists”","slug":"sam-deploy-fails-with-“stack-already-exists”","depth":3,"children":[]},{"title":"User is not authorized to perform iam:CreateRole","slug":"user-is-not-authorized-to-perform-iamcreaterole","depth":3,"children":[]},{"title":"Lambda function failed: PLAN_HASH_MISMATCH","slug":"lambda-function-failed-plan_hash_mismatch","depth":3,"children":[]},{"title":"Lambda function failed: BROWSER_GPU_NOT_SOFTWARE","slug":"lambda-function-failed-browser_gpu_not_software","depth":3,"children":[]},{"title":"Render seems stuck at RUNNING","slug":"render-seems-stuck-at-running","depth":3,"children":[]},{"title":"Long-video planning times out","slug":"long-video-planning-times-out","depth":3,"children":[]},{"title":"Tearing down doesn’t reclaim S3 storage","slug":"tearing-down-doesn’t-reclaim-s3-storage","depth":3,"children":[]},{"title":"STACK_TOO_OLD","slug":"stack_too_old","depth":3,"children":[]},{"title":"SITE_FILES_MISSING or SITE_NOT_FOUND","slug":"site_files_missing-or-site_not_found","depth":3,"children":[]}]},{"title":"Current limits","slug":"current-limits","depth":2,"children":[]},{"title":"Related topics","slug":"related-topics","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/docs.lltai.cloud/3e1dd9f13f45d886/docs-menu-label.js","/_mintlify/custom/docs.lltai.cloud/8a0fcba05bf0a907/download-attribution.js","/_mintlify/custom/docs.lltai.cloud/e197f5ee3156e18e/template-gallery.js"],"subdomain":"docs.lltai.cloud","siteName":"HyperFrames","title":"AWS Lambda - HyperFrames","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"originalFileLocation":"deploy/aws-lambda.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Deploy distributed HyperFrames rendering to AWS Lambda and drive renders from a laptop or CI.\">\u003cmeta data-mint-head name=\"application-name\" content=\"HyperFrames\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/favicons/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/favicons/favicon-32x32.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/favicons/favicon-16x16.png\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicons/favicon.ico\">\u003cmeta data-mint-head property=\"og:title\" content=\"AWS Lambda - HyperFrames\">\u003cmeta data-mint-head property=\"og:description\" content=\"Deploy distributed HyperFrames rendering to AWS Lambda and drive renders from a laptop or CI.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"HyperFrames\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://local./deploy/aws-lambda\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"http://docs.lltai.cloud/_mintlify/og/deploy/aws-lambda.png\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"AWS Lambda - HyperFrames\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Deploy distributed HyperFrames rendering to AWS Lambda and drive renders from a laptop or CI.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"http://docs.lltai.cloud/_mintlify/og/deploy/aws-lambda.png\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/favicons/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"HyperFrames\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#181716\">\u003clink data-mint-head rel=\"canonical\" href=\"https://local./deploy/aws-lambda\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/deploy/aws-lambda.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"HyperFrames\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"HyperFrames\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/deploy/aws-lambda.md","siteName":"HyperFrames","nav":{"tabs":[{"tab":"Docs","icon":"book-open","menu":[{"item":"Make a video","icon":"book-open","description":"Guides by kind of video","pages":[{"title":"Make a video","href":"/introduction"}]},{"item":"Studio app","icon":"laptop","description":"The desktop app","pages":[{"title":"Studio app","href":"/studio-app"}]},{"item":"Developers","icon":"code","description":"CLI, SDK and reference","groups":[{"group":"Start here","pages":[{"title":"How HyperFrames fits into an application","sidebarTitle":"Developer overview","href":"/developers/overview"},{"title":"Build on HyperFrames","sidebarTitle":"Developers","href":"/developers/index"},{"title":"How a HyperFrames project works","sidebarTitle":"Project model","href":"/concepts/index"}]},{"group":"Command line","pages":[{"title":"CLI guide","href":"/developers/cli"},{"title":"CLI","sidebarTitle":"CLI reference","href":"/packages/cli"},{"title":"Editable source in a share","href":"/developers/share-source"},{"title":"How catalog search works","href":"/developers/catalog-search"},{"title":"Running the CLI from an agent harness","href":"/developers/harness-tool-context"},{"title":"@hyperframes/lint","href":"/packages/lint"}]},{"group":"SDK guides","pages":[{"title":"Edit a composition with the SDK","sidebarTitle":"SDK quickstart","href":"/sdk/quickstart"},{"title":"Querying \u0026 Editing Elements","href":"/sdk/guides/querying-and-editing"},{"title":"Timing \u0026 Animation","href":"/sdk/guides/timing-and-animation"},{"title":"Undo, Redo \u0026 Patches","href":"/sdk/guides/undo-redo-and-patches"},{"title":"Persistence","href":"/sdk/guides/persistence"},{"title":"Embedded Override Mode","href":"/sdk/guides/embedded-override-mode"},{"title":"Canvas \u0026 Preview Integration","href":"/sdk/guides/canvas-integration"},{"title":"Editing Affordances","href":"/sdk/guides/editing-affordances"}]},{"group":"SDK reference","pages":[{"title":"openComposition","href":"/sdk/reference/open-composition"},{"title":"Composition","href":"/sdk/reference/composition"},{"title":"Edit Operations","href":"/sdk/reference/edit-operations"},{"title":"Types","href":"/sdk/reference/types"},{"title":"Adapters","href":"/sdk/reference/adapters"},{"title":"Utilities \u0026 Constants","href":"/sdk/reference/utilities"}]},{"group":"Composition, design \u0026 animation","pages":[{"title":"Compositions","href":"/concepts/compositions"},{"title":"Reuse a design with variables","sidebarTitle":"Variables","href":"/concepts/variables"},{"title":"Time elements with data attributes","sidebarTitle":"Data attributes","href":"/concepts/data-attributes"},{"title":"Animate with GSAP","sidebarTitle":"GSAP animation","href":"/guides/gsap-animation"},{"title":"Frame sources","href":"/guides/frame-sources"},{"title":"Imported film HTML","href":"/guides/imported-film-html"},{"title":"Frame adapters","href":"/concepts/frame-adapters"},{"title":"Deterministic Rendering","href":"/concepts/determinism"},{"title":"HTML in Canvas","href":"/guides/html-in-canvas"},{"title":"Motion Blur","href":"/guides/motion-blur"},{"title":"Per-pixel effects with data-vfx-chain","sidebarTitle":"VFX chain","href":"/guides/vfx-chain"},{"title":"Figma integration","href":"/guides/figma"}]},{"group":"Composition reference","pages":[{"title":"HTML schema reference","href":"/reference/html-schema"},{"title":"Color grading implementation","sidebarTitle":"Color grading","href":"/reference/color-grading"},{"title":"Audio effects implementation","sidebarTitle":"Audio effects","href":"/reference/audio-effects"},{"title":"Speed ramps","sidebarTitle":"Speed ramps","href":"/reference/speed-ramps"},{"title":"Lint rules","sidebarTitle":"Lint rules","href":"/reference/lint-rules"}]},{"group":"Rendering paths","pages":[{"title":"Render from the command line","href":"/guides/rendering"},{"title":"Choose a rendering path","sidebarTitle":"Rendering overview","href":"/deploy/overview"},{"title":"Cloud rendering","href":"/deploy/cloud"},{"title":"Deploy a preview and render API","description":"Start from an official Vercel, Cloudflare, or Modal template when you need a hosted preview and MP4 render endpoint.","sidebarTitle":"Hosted templates","href":"/guides/deploy"}]},{"group":"Cloud infrastructure","pages":[{"title":"AWS Lambda","href":"/deploy/aws-lambda"},{"title":"Google Cloud Run","description":"Deploy distributed HyperFrames rendering to Cloud Run, Cloud Workflows, and Google Cloud Storage.","href":"/deploy/gcp-cloud-run"},{"title":"Render templates on Lambda","href":"/deploy/templates-on-lambda"},{"title":"Migrating to HyperFrames Lambda","href":"/deploy/migrating-to-hyperframes-lambda"},{"title":"@hyperframes/aws-lambda","href":"/packages/aws-lambda"},{"title":"@hyperframes/gcp-cloud-run","href":"/packages/gcp-cloud-run"}]},{"group":"Advanced rendering","pages":[{"title":"4K rendering","href":"/guides/4k-rendering"},{"title":"Render HDR video","href":"/guides/hdr"},{"title":"Fix a slow preview or render","href":"/guides/performance"}]},{"group":"Packages","pages":[{"title":"@hyperframes/core","href":"/packages/core"},{"title":"@hyperframes/parsers","href":"/packages/parsers"},{"title":"@hyperframes/studio-server","href":"/packages/studio-server"},{"title":"@hyperframes/sdk","href":"/packages/sdk"},{"title":"@hyperframes/engine","href":"/packages/engine"},{"title":"@hyperframes/player","href":"/packages/player"},{"title":"@hyperframes/producer","href":"/packages/producer"},{"title":"@hyperframes/shader-transitions","href":"/packages/shader-transitions"},{"title":"@hyperframes/studio","href":"/packages/studio"}]},{"group":"Agent setup","pages":[{"title":"Authentication \u0026 API keys","href":"/guides/authentication"},{"title":"Let an agent drive Studio","sidebarTitle":"Agent tools (WebMCP)","href":"/guides/webmcp"}]},{"group":"Contributing \u0026 community","pages":[{"title":"Contribute to HyperFrames","href":"/contributing"},{"title":"Contribute to the Catalog","href":"/contributing/catalog"},{"title":"Release channels","href":"/contributing/release-channels"},{"title":"Release agent plugins","href":"/contributing/agent-plugins"},{"title":"Changelog process","href":"/contributing/changelog-process"},{"title":"Test local CLI changes","href":"/contributing/testing-local-changes"},{"title":"Canary rollouts","href":"/contributing/canary-rollouts"},{"title":"Adopters","href":"/community/adopters"}]}]},{"item":"Free lessons","icon":"graduation-cap","description":"A free video course","href":"https://hyperframes.heygen.com/lessons"},{"item":"Community","icon":"users","description":"Videos people made","href":"https://hyperframes.studio/?view=community\u0026src=docs-navbar"},{"item":"App changelog","icon":"sparkles","description":"What's new in the app","href":"https://hyperframes.studio/changelog?src=docs-navbar"}]},{"tab":"Catalog","icon":"grid-2","pages":[{"title":"Catalog","href":"/catalog"}]}]},"basePath":"","title":"AWS Lambda - HyperFrames","buildId":"44983560cdbd","dynamics":[],"chunks":[]}