Setting total number of requests that can be made on HTTP Api Gateway

0

Hi, I wondering if there is any possibility to set maximum total number of requests that can be made on HTTP Api Gateway. In case of REST Api gateway we can use a Usage plan for this. Looking for similar solution.

In my case I need this to secure my endpoints from being called maliciously (spikes in traffic for which I need to pay) & . Not sure if setting only Burst and Rate limit will be enough to secure.

I just want set fix value - for example to set gateway to process at most 10 000 000 requests per month and then can stop working.

symaaa
asked 2 months ago96 views
1 Answer
0

You can't do that directly; but what you could do is use a custom authorizer which stores the number of calls from each client in a persistent manner (DynamoDB perhaps?) and then allows or disallows access based on the number of requests.

It's extra work to do; the alternative is to use the REST API Gateway service.

profile pictureAWS
EXPERT
answered 2 months ago
  • This will only work if you disable authorization caching, which will increase the cost as API GW will invoke the Lambda function for each request.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions