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 Risposta
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
ESPERTO
con risposta 2 mesi fa
  • 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.

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande