Prompt
Lambda@Edge not triggering on requests
Latest observation
If your Lambda@Edge function isn’t triggering, the cause is usually one of a few common issues. Here’s a quick checklist to narrow it down:
1) Confirm the event type is correct
Lambda@Edge can be attached to:
- Viewer request
- Viewer response
- Origin request
- Origin response
Make sure you attached it to the event you actually expect to fire.
2) Make sure it’s associated with the CloudFront distribution
Check:
- CloudFront distribution → Behaviors
- Edit the behavior your request matches
- Verify the Lambda association is present on that behavior
If the request is hitting a different behavior, the function won’t run.
3) Ensure the distribution is deployed
Changes to CloudFront take time to propagate.
- Wait until the distribution status is Deployed
- Then test again
4) Use a versioned Lambda ARN
Lambda@Edge requires a published version, not $LATEST.
Example:
- ✅
arn:aws:lambda:us-east-1:123456789012:function:my-fn:3 - ❌
...:function:my-fn:$LATEST
5) The Lambda must be in us-east-1
Lambda@Edge functions must be created in:
- US East (N. Virginia)
us-east-1
Even if your CloudFront distribution serves globally, the Lambda function must originate from that region.
6) Check the behavior path pattern
Your request path must match the CloudFront behavior that has the Lambda attached.
Example:
- Behavior:
/api/* - Request:
/images/logo.png
That request won’t trigger the function.
7) Verify permissions
The Lambda execution role and resource policy must allow CloudFront to invoke it.
If the association was created through the console, this is usually handled automatically, but custom deployments can miss this.
8) Review logs in CloudWatch
Lambda@Edge logs appear in the region where the edge function executes, not necessarily only in one place.
Check:
- CloudWatch Logs for the function
- Also confirm the function is actually being invoked with expected headers/path
9) Make sure you’re testing a cache miss if using origin events
If attached to:
- Origin request/response, it only runs when CloudFront goes to the origin
- A cached response may skip it
If you want it to run on every request, use viewer request.
10) Test with a real CloudFront URL
Make sure you’re requesting through CloudFront, not directly from the origin.
Lambda@Edge won’t trigger on direct origin requests.
Fastest debugging approach
- Attach the function to viewer request
- Ensure it’s a published version
- Confirm the behavior path matches
- Test the CloudFront domain
- Look at CloudWatch logs
If you want, paste:
- the event type you attached,
- your behavior path pattern,
- and whether the function is versioned in
us-east-1
and I can help pinpoint the issue.