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
demandé il y a 2 mois145 vues
1 réponse
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
EXPERT
répondu il y a 2 mois
  • 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.

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions