Is it possible to set pathParameter as an Identity source in API Gateway Authorizer?

0

I'm utilizing an API Gateway and have established a custom Authorizer Lambda. I'm interested in implementing Authorization caching to store policies for quicker access. However, I'd like to utilize a PathParameter as the cache key. To illustrate, let's consider I have a URL like https://mytest.com/{projectId}/test. My goal is to designate projectId as the cache key. This way, as long as the projectId remains consistent, the authorizer only needs to execute once. Any idea about that? Thank you.

1개 답변
0

Hi, according to the following re:Post responses, for a REST API and a REQUEST type Lambda, the default cache key used for Lambda authorizers is the resource path.

profile picture
전문가
답변함 2달 전
  • I apologize if my initial explanation was not clear. To clarify, I am seeking to establish a PathParameter as a component of the cache key. For instance, if the URL is https://mytest.com/{projectId}/test, and I receive 10 requests all sharing the same projectId, I aim to activate the Authorization Lambda only for the initial request. Subsequent requests should then be able to retrieve the policy from the cache. I'm wondering if such a setup is feasible within AWS API Gateway.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠