Setting the authorization type to CUSTOM or COGNITO_USER_POOLS requires a valid authorizer

aws
api-gateway

#1

Hi All,

I have problem when attaching custom authorizer on API gateway endpoint. Here are my scenario step :
a. Create custom authorizer (using lambda function).
b. Create new endpoint with integration type as HTTP.
c. Set AuthorizationType as CUSTOM

How I attach my custom authorizer on serverless yaml ?

  • I try using AuthorizerId, got error “ProxyMethod - Invalid authorizer ID specified. Setting the authorization type to CUSTOM or COGNITO_USER_POOLS requires a valid authorizer.”
  • I didn’t find example code on serverless documentation for my scenario above
  • I try to follow AWS docs . It explain to use AuthorizerId, but not sure whether serverless support it or not.

Could someone assist me on this ?

*note : The script above has been simplified. customAuthorizer above also attached on other lambda endpoint