Can I use API Gateway cache invalidation with a custom authorizer ?

1

I use API Gateway with a custom authorizer to authorize http requests based on a JWT Bearer token (header Authorization: Bearer <jwt>). I activated the cache layer and I would like to invalidate the cache entry on specific resource when the resource has been modified.

With an IAM authorizer, I was able to test the cache invalidation mecanism described in this documentation https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html#override-api-gateway-stage-cache-for-method-cache . I used a lambda function to call the API Gateway assuming a role with the proper policy "execute-api:InvalidateCache".

The problem is that I want a use a custom authorizer instead of the IAM authorizer and it does not seem to be possible. I tried to return the policy "execute-api:InvalidateCache" from my custom authorizer but the API Gateway does not authorize the cache invalidation.

Could you tell me if I am missing something or is it just not supported ?

1개 답변
1

Hello,

Thanks for reaching out to us!

At the moment only AWS_IAM authorization on the same-account supports cache invalidation.

If you use API Gateway with Lambda authorizers it does not support cache invalidation at the moment.

AWS
지원 엔지니어
Tim_P
답변함 2년 전
  • Greetings Tim P,

    We are attempting to address the same concern but are encountering a similar problem. Have there been any recent updates that provide support for cache invalidation in the context of AWS API Gateway when using Lambda authorizers?

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

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

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

관련 콘텐츠