API Gateway vs ALB vs Lambda Function URLs

Function URLs are the simplest, API Gateway is the most feature-rich, and an ALB fits best alongside containers and servers.

There are three common ways to give a Lambda function (or other backend) an HTTPS address.

Side-by-side

Lambda Function URLAPI Gateway (HTTP API)Application Load Balancer
SetupOne setting on the functionAn API with routesLoad balancer, listeners, target groups
Routes toOne functionMany routes to many backendsLambda, EC2, containers, IPs
AuthIAM or noneJWT (e.g. Cognito), IAM, Lambda authorizersOIDC or Cognito sign-in actions
ThrottlingOnly via the function's concurrencyPer route and per stageNo built-in request throttling
Custom domainVia CloudFrontBuilt inBuilt in
PricingNo extra chargePer million requestsPer hour + capacity units
Notable limitsOne function per URL~30 s integration timeout, 10 MB payloads1 MB payloads to Lambda targets

Choose a Function URL when…

  • You have one function that needs a URL: a webhook receiver, a simple internal tool, or a prototype.
  • You want response streaming from Lambda.

Choose API Gateway when…

  • You're building a real API with multiple routes.
  • You need JWT auth, throttling, CORS, stages, or usage plans.

Choose an ALB when…

  • You already run containers or EC2 behind an ALB and want to add some Lambda routes to the same domain.
  • Traffic is very high and steady, where hourly load balancer pricing can beat per-request pricing.
Tip

Starting a new serverless API? Default to API Gateway HTTP API. Move a route elsewhere only if you hit a specific limit.

Learn more: API Gateway types, Put a URL on your function, and EC2 with a load balancer.

Key takeaways

  • Function URLs: simplest, free, one function.
  • API Gateway: routing, auth, throttling, CORS, the default for serverless APIs.
  • ALB: best when mixing Lambda with containers or servers, or at high steady traffic.

Learn the details