feat(aws-lambda): run chunks on an optional arm64 image function

A new VideoImageUri parameter adds an arm64 container-image function that only
renders chunks. Plan, audio and assemble stay on the x86 ZIP function, so audio
encodes are unchanged. Empty (the default) deploys exactly as before. The
reserved concurrency moves to whichever function renders the chunks.
This commit is contained in:
Miguel Ángel
2026-10-22 12:18:24 -04:00
parent 934c88bac8
commit 79efebaa5f
2 changed files with 108 additions and 13 deletions
@@ -345,6 +345,32 @@ describe("HyperframesRenderStack — snapshot", () => {
}
});
it("sends only renderChunk to the SAM template's optional arm64 video function", () => {
// Plan, audio and assemble encode audio; on the x86 function that audio stays byte-identical.
const targets = Object.values(lambdaTasks(readSamDefinition().States)).map((task) => ({
action: sentPayload(task).Action,
functionName: requireRecordProperty(requireRecord(task, "task"), "Parameters", "task params")
.FunctionName,
}));
expect(new Set(targets.map((target) => target.action))).toEqual(
new Set(["plan", "renderChunk", "audio", "assemble"]),
);
for (const { action, functionName } of targets) {
expect({ action, functionName }).toEqual({
action,
functionName:
action === "renderChunk"
? ["HasVideoFunction", "VideoFunction.Arn", "RenderFunction.Arn"]
: "RenderFunction.Arn",
});
}
const samRole = requireRecord(readSamResources().RenderStateMachineRole, "SAM role");
const invoke = JSON.stringify(
requireRecordProperty(samRole, "Properties", "SAM role properties").Policies,
);
expect(invoke).toContain('["RenderFunction.Arn",["HasVideoFunction","VideoFunction.Arn"');
});
it("lets the render function abort the multipart uploads its S3 stitch starts", () => {
const cdkPolicies = JSON.stringify(SYNTHED.template.findResources("AWS::IAM::Policy"));
expect(cdkPolicies).toContain("s3:Abort*");