Reputation: 43
I have a resource in AWS API Gateway, currently it included:
The problem is AWS API Gateway only support to configure 01 resource with 01 authorizer (Cognito User Pool or AWS_IAM). So, what is solution to support validate authorize with both methods (Cognito User Pool and AWS_IAM)?
I have an idea that using Lambda function for authorizer but I am not sure that it is support validate authorize with AWS_IAM. If it is possible could someone help me with a sample code Nodejs for Lambda function?
Thanks.
Upvotes: 0
Views: 492
Reputation: 1179
This assumption is not correct.
An authorizer can be added at API Gateway level, but authorization type can be selected for each API, it can be either IAM or it can be Cognito.
So, as requested, a set of APIs can have IAM as authorizer and another can have Cognito as the authorizer.
Upvotes: 0