I have setup a lambda function url and cloudfront system
- Lambda Function Url is straight forward, a function that will return an image or a json value
- Cloudfront using this setting:
- Origins:
- Origin Domain: {LAMBDA FUNCTION URL}
- Protocol: HTTPS only - TLSv1
- Enable Origin Shield: No
- Behavior:
- Viewer:
Redirect HTTP to HTTPS
- Allowed HTTP Method:
GET, HEAD
- Restrict Viewer Access:
No
- Cache Policy:
Managed-CachingDisabled
- Origin request policy:
AllViewer
- Viewer:
- Origins:
The result however always return 403 Forbidden
with this body
{ "Message": null }
And this header
X-cache: Error from cloudfront
x-amzn-ErrorType: AccessDeniedException
Is there any setting that I missed that cause this error? I already test direct hit using postman and browser to the function url an it works fine
origin
anduser-agent
but it is because of my lambda function code. – Payable