chalice icon indicating copy to clipboard operation
chalice copied to clipboard

[proposal] Add support for throttling per route

Open jamesls opened this issue 6 years ago • 6 comments

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

jamesls avatar Nov 17 '17 20:11 jamesls

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:

kyleknap avatar Nov 17 '17 20:11 kyleknap

3 years later... any updates on this? Very useful feature

atyshka avatar Aug 03 '20 14:08 atyshka

4 years later... any updates on this? Very useful feature

isohrab avatar Mar 25 '21 21:03 isohrab

Would be awesome to have

tedmiston avatar Sep 22 '21 20:09 tedmiston

We are getting this when?

dhensen avatar Sep 29 '21 19:09 dhensen

5 years later... any updates on this? very useful feature

denpufa avatar Mar 27 '22 01:03 denpufa

6 years later.... i guess it never comes

nqbao avatar Mar 15 '23 02:03 nqbao