How do I limit calls per minute to my api endpoint...
# help
k
How do I limit calls per minute to my api endpoint/lambda?
k
Thanks! but what does these numbers mean?
Copy code
defaultThrottlingRateLimit: 2000,
  defaultThrottlingBurstLimit: 100,
can I set throttling conditionally? i.e based on who's requesting
a
Haven't really worked with throttling, I guess you can create a UsagePlan with cdk and add it to each functions as needed. As for the "per user" throttling thing, I think you need something custom for that, but I am not sure. https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.UsagePlan.html#methods
f
Thanks @Arpad!
@Karolis Stulgys
sst.Api
uses API Gateway HTTP API behind the scene and it doesn’t support requester based throttling.
sst.ApiGatewayV1Api
uses the API Gateway REST API behind the scene, and it supports Usage Plan and Api Key as @Arpad suggested.
The latter is more feature rich, but a bit more expensive and a bit slower.