AWS API Gateway with Amazon Cognito User Pools as authorizer

0

A customer is interested in using Amazon Cognito User Pools instead of Lambda functions as authorizers for AWS API Gateway. They are trying to figure out if this solution would be ok for production workloads, also focusing on the performance overhead introduced by Cognito. In the past they used to use a Lua backend with HA Proxy and they experienced great performance (overhead in the order of microseconds), so now they are wondering if Cognito can offer good performance as well, maybe adopting some kind of optimizations (caching?). Are there any best practices about that? I don't see any reference to caching in the related documentation webpage.

Thanks a lot.

1 回答
0
已接受的回答

Cognito is used for Authentication, so it is only used once at the beginning of the session. Once the client gets a token, it uses the same token in all API calls and API Gateway knows how to interpret that token.

There are no caching controls for Cognito authorizers, but it may well be that API Gateway implements one. The best would be to run a test and find out if the latency is too high.

If latency is an issue for the customer, I recommend using the HTTP API which is 60% less latency compared to the REST API (and also costs 70% less).

profile pictureAWS
专家
Uri
已回答 3 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则