serverless-http
serverless-http copied to clipboard
Using this library with AWS function URLs?
AWS Lambda Function URLs are different from regular API Gateway URLs, in that they support IAM authentication, and they are also cheaper to use.
Does this library have support for an AWS Lambda that has a function URL instead of an API Gateway integration?
It will need some modification, I can't promise I will work on it but I might, otherwise PRs welcome
It works fine on it's own (without IAM authentication), if you need to access the original event I suggest you use the options
argument to amend the incoming req
:
export const handler = serverless(app,{
request(req, event, context) {
// Append event & context to the request
req.lambdaEvent = event;
req.lambdaContext = context;
},
});
Then in your framework, req.lambdaEvent
would have the original event for you to access the IAM-specific request context you're after.
I can confirm that Lambda Function URL's works fine.