Hello, I have a simple handler with lambda authorizer configured. The handler works fine in offline. But in AWS, it is failing with 500 Internal Server error. The handler works fine in AWS if authorizer is not configured in serverless YML.
Handler
module.exports.hello = async (event, context, callback) => { const responseBody = { "key3": "value3", "key2": "value2", "key1": "value1" }; const response = { "statusCode": 200, "headers": { "my_header": "my_value" }, "body": JSON.stringify(responseBody), "isBase64Encoded": false }; return response; };
Serverless YML Functions
functions: authorize: handler: handlers/authHandler.authenticate hello: handler: handlers/helloHandler.hello events: - http: path: hello method: get cors: true authorizer: authorize