Choose an execution envelope, not just “the edge”
How execution location, request lifecycle stage, runtime constraints, and regional dependencies determine whether CloudFront Functions, Lambda@Edge, or regional compute can meet end-to-end latency requirements. · advanced
Execution location determines which network journeys processing can avoid. CloudFront Functions runs lightweight JavaScript at CloudFront edge locations. Lambda@Edge runs in CloudFront regional edge locations, not necessarily at the viewer’s nearest edge location. Regional compute runs in your selected AWS Region. None guarantees an end-to-end latency target merely by being distributed.
Runtime constraints decide which work can move. CloudFront Functions has no request-body access or general outbound network access; its supported CloudFront KeyValueStore integration is not permission to call arbitrary APIs. Lambda@Edge supports Node.js and Python, outbound network calls, and opt-in request-body access subject to truncation and event limits, but cannot attach to your VPC. Regional compute is the appropriate envelope for private database access and application work outside edge runtime limits.
Do not confuse nearby services with execution hooks. AWS Global Accelerator routes traffic rather than running CloudFront handlers; AWS WAF evaluates security rules rather than arbitrary JavaScript handlers. Amazon API Gateway handles APIs, and Amazon EC2 hosts application code, but neither provides a CloudFront lifecycle function association.
| Execution choice | Location | Lifecycle hooks | Dependency access |
|---|---|---|---|
| CloudFront Functions | Viewer edge locations | Viewer request/response | No general network |
| Lambda@Edge | Regional edge locations | Viewer and origin events | Network; no VPC attachment |
| Regional compute | Selected AWS Region | Application request handling | VPC access when configured |
AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.