I am trying to create a custom authorizer for my Lambda functions deployed behind API Gateway in AWS.
I have the authorizer function deployed.
Then I configure the authorizer in serverless.yml as per the instructions in the Serverless docs, but when I test the created authorizer, API Gateway says it has no permission to invoke the authorizer lambda.
When creating an authorizer in the API Gateway UI, the permissions are granted automatically and the authorizer works. I expected the authoirzer created by Serverless to grant the permissions as well.
What am I missing here?
Turns out I was wrong and the Serverless framework does handle granting the permissions on the Authorizer Lambda. I was missing the policy that allows API Gateway to control the lambda function as described here.
Hopefully someone someday will stumble upon this and get some time saved!