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.

Neal
gefragt vor 2 Monaten144 Aufrufe
1 Antwort
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
EXPERTE
beantwortet vor 2 Monaten
  • 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.

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen