chalice
chalice copied to clipboard
[proposal] Add support for throttling per route
API Gateway has various forms of API throttling. This proposal adds support for throttling at the routing level. This allows you to specify a rate and burst limit per @app.route.
Similar to CORS and authorizers, there will be a new param, throttle, that takes an instance of ThrottleConfig:
@app.route('/', throttle=ThrottleConfig(rate=10, burst=15))
def index(): pass
ThrottleConfig accepts two arguments, rate and burst:
class ThrottleConfig(object):
def __init__(self, rate: int, burst: int): pass
The rate and burst params map to the corresponding concepts described in the API Gateway throttling docs
It might be good to mention that we could potentially attach the ThrottleConfig to the app.api as well to represent the stage-wide throttle configuration. Otherwise, :ship:
3 years later... any updates on this? Very useful feature
4 years later... any updates on this? Very useful feature
Would be awesome to have
We are getting this when?
5 years later... any updates on this? very useful feature
6 years later.... i guess it never comes