Skip to content

Source Lambda Web Functions

Reese Hodge edited this page Oct 22, 2026 · 1 revision

Source: AWS Lambda Web Functions

AWS announced Lambda Web Functions in a blog post and a documentation set, read 2026-10-22. A Web Function runs an ordinary port-listening Node.js HTTP server on Lambda, with no event-handler adapter. Nothing here is adopted. The "What it could change" section is analysis, and the page's open questions decide whether it is worth a spike for Source-Spec-003. Rates were added 2026-10-22.

What it is

Lambda now has three form factors. Web Functions sit between the two we already know:

Form factor Model Billing
Event Functions The classic handler; one request per environment Wall-clock duration
Web Functions Your server listens on a port; many requests per environment Requests, active CPU time, memory for the environment's life, data transfer
MicroVMs Isolated stateful sandboxes with a customer-managed lifecycle Per instance-second

A Web Function is three resources: the function, revisions (immutable code and config snapshots) and endpoints (an HTTPS URL routing to one or two revisions by weight). CloudFormation has AWS::Lambda::WebFunction, ...Revision and ...Endpoint. The installed aws-cdk-lib 2.273.0 ships CfnWebFunction, CfnWebFunctionRevision and CfnWebFunctionEndpoint (checked in lambda.generated.d.ts). It has no L2 construct and no CloudFront origin helper for Web Functions, though OriginAccessControlOriginType.LAMBDA exists.

Facts that matter to us

Fact Source page
Node.js only; one runtime, nodejs24.x, on Arm64; ships as a .zip from S3, up to 512 MB unzipped. No container image web-functions-runtimes, blog
The server reads its host and port from AWS_LAMBDA_HTTP_ENDPOINT and must listen within 10 s web-functions-env-lifecycle
Each environment is a fixed 2 vCPU and 2 GB, serving up to 128 concurrent requests (default 64) gettingstarted-limits, web-functions-runtimes
No session affinity. Requests are routed to any ready environment; process state is lost on shutdown, and the docs say to persist anything important to DynamoDB or S3 web-functions-env-lifecycle
Streaming (SSE, chunked) is native. The request timeout is 3–900 s, default 30 s, and bounds the whole stream; a timed-out stream ends with status 200 and a truncated body web-functions-revisions-timeout
SIGTERM gives a process 1 second to clean up web-functions-env-lifecycle
Endpoint auth is IamAuth or ApplicationManaged (Lambda authenticates nothing; your code validates the token) web-functions-endpoint-access-control
CloudFront OAC works with IamAuth endpoints (origin type lambda, signing always-amz-auth). CloudFront passes the viewer's Authorization header through, so app-level JWT still works same
The endpoint domain stays reachable on the internet even behind OAC; Lambda also accepts direct signed requests from any principal the policies allow same
Endpoint rateLimit (0–10,000 rps) and maxEnvironments (2–10,000) cap traffic per Region. Over the cap, requests get 429 web-functions-scaling
Available in us-east-1, us-east-2, us-west-2, ap-northeast-1 and eu-west-1. us-west-2 is our Region blog
New accounts get reduced vCPU and request-rate quotas until AWS raises them from usage gettingstarted-limits
Multi-Region endpoints exist (--regions, one global URL, latency routing). Egress network connectors are HomeRegion only blog, gettingstarted-limits
AWS Lambda is on the Free plan's supported-services list, with no Web-Function qualification either way supported-services-sign-up-new

Pricing

Read by the builder from the Web Functions tab of the Lambda pricing page on 2026-10-22 (it renders client-side, so a fetch cannot see it), Graviton (ARM), US West (Oregon):

Dimension Price Per hour
Active vCPU $0.0000276944 per vCPU-second $0.0997 per vCPU-hour
Memory $0.0000036667 per GB-second $0.0132 per GB-hour
Requests $0.30 per million

Compute bills at 1 ms granularity, with CPU and memory shared across an environment's concurrent requests. Data transfer is at standard AWS rates.

The hourly figures equal AgentCore Runtime's announced committed-baseline V2 rate ($0.0997 per vCPU-hour, $0.0132 per GB-hour; Source-AgentCore-Pricing), which suggests the two share a rate card. This is an observation, not a claim AWS makes.

Per hour Web Functions AgentCore V1 AgentCore V2 on-demand
vCPU $0.0997 $0.0895 $0.1276
Memory (GB) $0.0132 $0.00945 $0.0169

So Web Functions are about 22% cheaper than on-demand V2 on both lines, about 11% dearer than V1 on CPU and 40% dearer on memory. The comparison is of rates, not bills.

What the rates do not settle:

  • Memory has a floor. An environment is a fixed 2 GB, so each live environment costs about $0.0264 per hour in memory alone, even with no CPU in use. One always-warm environment for a month would be about $19, over P2's $10 cap, so scale-to-zero and maxEnvironments are load-bearing, not optional.
  • Requests are a per-call line. At $0.30 per million it is negligible at friends-and-family volume. This page did not check whether AgentCore Runtime has a comparable line.
  • CPU is only the time actively used. I/O wait on the model stream is not billed, which is the point of the form factor, but it is unmeasured for our workload. A spike has to measure it.
  • Idle memory retention is undocumented (see below), and decides the idle bill.

What is not known

  • Whether any free tier applies to Web Functions. The Event Functions tab states 1M requests and 400,000 GB-s free; the Web Functions screenshot shows no free-tier line. Treat Web Functions as fully billed until AWS says otherwise.
  • How long an idle environment lives before scale-down. Memory bills for the environment's whole life, so this decides the idle cost. The docs give no figure (AgentCore V2 reclaims idle memory after 120 s).
  • Whether the Free plan allows a Web Function at all. AWS Lambda is listed generically.
  • Cold-start time for our bundle. The docs describe cold starts but publish no figure.
  • Whether a CDK L2 or cloudfront-origins helper is coming. Today it is L1 plus S3 assets.

What it could change (analysis, not decision)

Spec 003's Q4 picks CloudFront → AgentCore Runtime V2 over SSE, with a Lambda streaming proxy as the fallback if the first-deploy probe (V-02) fails (Source-Spec-003). Web Functions touch both halves of that.

As the Q4 fallback: a clear improvement

If V-02 fails, the fallback is a hand-built Event Function streaming proxy. A Web Function replaces it with an ordinary Hono or Express app, behind CloudFront with OAC. The path is documented by AWS, including Authorization passthrough, so "does CloudFront forward the JWT" stops being a probe. This costs nothing until the probe fails, so it is the safe way to take the idea.

As a replacement for the AgentCore runtime: simpler to deploy, harder to keep correct

Dimension AgentCore Runtime V2 (spec 003) Web Function
Artifact ECR container image, so Docker at deploy time .zip from S3 (CDK asset)
Platform version platformVersion needs an untyped override; a typo silently deploys V1 (Decision-AgentCore-Runtime-V2) None
Platform price V2 is +42% CPU and +79% memory over V1 (Source-AgentCore-Pricing) About 22% under V2 on-demand, 11% to 40% over V1 (rates only); plus $0.30 per million requests
Front door CloudFront → data-plane origin; unproven (V-02) CloudFront OAC; documented
JWT validation Built-in authorizer (discoveryUrl, audience, clients) We write it; see below
Session state One Agent per session in a per-session microVM None; every session's state moves to DynamoDB
Resources CfnRuntime, ECR, CfnMemory Three Cfn* resources, S3 asset; CfnMemory stays

Two costs are real. First, spec 003's in-session history (Q8) lives inside a runtime-session microVM. A Web Function shares one environment across many concurrent requests, with no affinity, so the history, the counted-session state and the P-05 strict-continuity rule would all need a DynamoDB round trip per turn. Second, ApplicationManaged auth means the app verifies the Cognito JWT itself. That needs a JWKS-aware library such as jose, which is a new dependency under Concept-Supply-Chain-Discipline (gate 3), or hand-written WebCrypto, which is worse.

The Concept-Budget-Ceiling angle is partly resolved. The rates favour Web Functions over V2 on-demand, but memory is billed for the life of each fixed 2 GB environment (see Pricing), so the bill turns on idle retention, which is undocumented. maxEnvironments and rateLimit are useful P2 controls, since they cap spend at the endpoint. The break-even against AgentCore still needs measured traffic.

Other effects

  • It adds no new capability for the speech path. Source-AgentCore-Bidirectional-Streaming covers WebSocket on AgentCore; Web Functions advertise SSE and chunked transfer only.
  • Constitution. The technology table names AgentCore for agent deployment, so replacing the runtime needs an amendment, the same class of change as spec 003's A1–A3.
  • Maturity. This is a launch-week service: one runtime, L1-only CDK, new-account quota limits. The project's stated preference is stable over bleeding edge.

Recommendation recorded

  1. Do not change spec 003's Q4 now. The V2 path may work, and the plan is already written.
  2. Name Web Functions as the Q4 fallback if V-02 fails, instead of a hand-built streaming proxy.
  3. Before any deeper move, a spike deploys the existing agent as a Hono server behind CloudFront. It measures cold start, first-token latency, active CPU per turn, idle environment lifetime and the DynamoDB cost of externalized session state. The price is now read, so the spike needs only an estimate and the builder's approval.
  4. Replacing the runtime trips two Spec Kit triggers (a changed cost model, a constitution amendment), so it needs /speckit.clarify against spec 003, not a pull request.

See Source-Spec-003 for the plan this is measured against.

Clone this wiki locally