DianaIonita / serverless-api-gateway-throttling

A plugin for the Serverless framework which configures throttling for API Gateway endpoints.
ISC License
69 stars 7 forks source link

TypeError: settings.restEndpointSettings is not iterable #31

Closed marco-rmz closed 1 year ago

marco-rmz commented 1 year ago

I know that this issue is because the custom variables are not in the serverless.yml

apiGatewayThrottling: maxRequestsPerSecond: 10000 maxConcurrentRequests: 5000

Is there a way to only apply the configuration to one single endpoint and avoid having a global configuration?

DianaIonita commented 1 year ago

Hi @marco-rmz,

Thank you for your question. The plugin is currently designed to work with a global configuration, because it makes it obvious that throttling settings are applied. API Gateway, by default, applies them, mentioning that Your current account level throttling rate is 10000 requests per second with a burst of 5000 requests (read more about that here). If you leave the default configuration as is and you have 2 endpoints in your account, when one of them hits these limits, it prevents the other from being invoked. I would, therefore, strongly advise you to configure your endpoints with more suitable throttling limits. I am unaware of any workarounds to avoid having to define a global configuration (which is actually a per-stage configuration) and, given the above, there are currently no plans to make it optional.

marco-rmz commented 1 year ago

@DianaIonita

Thank you for your quick answer and for your advice, is really helpful.