feat(lambdaweb): accept code up to 512 MiB and refuse more as AWS does (#6218)

* feat(lambdaweb): accept code up to 512 MiB and refuse more as AWS does

AWS takes a Web Function package of up to 536870912 bytes, zipped and
unzipped. A larger object is a 400 ValidationException at creation. A zip
whose files add up to more gives a Failed revision.

* fix(lambdaweb): add the declared sizes as unsigned numbers like AWS

AWS adds the sizes as unsigned 64-bit numbers and stops at the largest
one. A zip that declares sizes past the signed range is Failed too.

* test(lambdaweb): declare the large sizes instead of writing them
This commit is contained in:
TATSUNO “Taz” Yasuhiro authored and GitHub committed 2026-10-22 10:40:03 -04:00
1 parent 5419b3cfd1
commit 2720f84884
9 files changed
+224 -33

No files matched your search

+1 -1
View File
@@ -35,7 +35,7 @@ The `Lambda Web` service model (apiVersion 2025-03-07, `aws lambda-web` in the A
## Emulation Behavior
- **Instant convergence:** a revision and an endpoint are stored `Active`, or `Failed` as below, and an endpoint update is stored `Successful`. The create and update responses still report the transitional state AWS reports (`Pending`, `updateStatus: InProgress`, and the per-region block as it was before the update), so a waiter sees one poll.
- **Failed revisions:** a revision whose code is not a zip is stored `Failed`, as on AWS. It cannot be deployed: weights that name it, or `LatestRevision` while it is the newest revision, are `409 ConflictException`, and `LatestRevision` endpoints stay on their revision. The endpoint of a `CreateWebFunction` whose revision fails is `Failed` too. It answers every request with `409` and `Platform.EndpointNotActive` and refuses updates until it is deleted. In a stack, the revision's resource fails with the revision's `stateReason` and the rollback deletes it. An empty object is a `500 InternalServerException` with the body `{}`, as on AWS.
- **Failed revisions:** a revision whose code is not a zip, or whose files add up to more than 512 MiB, is stored `Failed`, as on AWS. It cannot be deployed: weights that name it, or `LatestRevision` while it is the newest revision, are `409 ConflictException`, and `LatestRevision` endpoints stay on their revision. The endpoint of a `CreateWebFunction` whose revision fails is `Failed` too. It answers every request with `409` and `Platform.EndpointNotActive` and refuses updates until it is deleted. In a stack, the revision's resource fails with the revision's `stateReason` and the rollback deletes it. An empty object is a `500 InternalServerException` with the body `{}`, and an object over 512 MiB is a `400 ValidationException`, as on AWS.
- **Code comes from S3 only.** The object named in `buildConfig.codeConfig.s3Object` must exist in Floci's S3, as on AWS. AWS also requires bucket versioning and a bucket policy for the Lambda service principal. Floci does not check them yet.
- **Each revision keeps its own copy of the code**, read at creation from the version the request names or the current one, under the Lambda `code-path`. As on AWS, a later write or delete in the bucket does not change what the revision runs. AWS moves a revision to `Failed` when it later finds its object version gone, which Floci does not do.
- **Execution role and network connector** ARNs are checked for shape only. The assume-role check AWS makes is not done yet.