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
已提問 2 個月前檢視次數 108 次
1 個回答
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
專家
已回答 2 個月前
  • 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.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南