# Throttling a service

**URL:** <https://forum.serverless.com/t/throttling-a-service/2024>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [June 8, 2017, 10:17am UTC](https://forum.serverless.com/t/throttling-a-service/2024 "2017-06-08T10:17:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DrNiels](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/drniels/32/2550_2.png) [@DrNiels](https://forum.serverless.com/u/DrNiels)\
**Post date:** [June 8, 2017, 10:17am UTC](https://forum.serverless.com/t/throttling-a-service/2024/1 "2017-06-08T10:17:11Z")

</div>

Hi,

I’m trying to set the throttling burst and rate limit for a service that is implemented in Serverless. As far as I looked, there is no serverless-specific way to do this, but I should be able to modify the AWS::ApiGateway::Deployment resource accordingly. So, here’s what I added to my serverless.yml:

```
resources:
  Resources:
    ApiGatewayDeployment1496846933333:
      Properties:
        StageDescription:
          ThrottlingBurstLimit: 10
          ThrottlingRateLimit: 1

```

The identifier ApiGatewayDeployment1496846933333 is used in the template of my service in CloudFormation and is the only AWS::ApiGateway::Deployment object there.

However, when I deploy the service again, the changes do not appear and the default throttling remains. What am I doing wrong? Or is there another approach for setting the throttling?

---

<div class="post-metadata">

**Author:** ![DrNiels](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/drniels/32/2550_2.png) [@DrNiels](https://forum.serverless.com/u/DrNiels)\
**Post date:** [June 8, 2017, 11:48am UTC](https://forum.serverless.com/t/throttling-a-service/2024/2 "2017-06-08T11:48:46Z")

</div>

I just realized that I constantly deployed on the wrong service, so I did not send the resource to AWS…  
However, it’s still not working.  
With the feedback of serverless, I added Type, RestApiId, and StageName. I realized that the number behind the ApiGateWayDeployment seems to change with every deployment, so I cannot overwrite the existing one (or at least, I don’t know how). With my adjusted serverless.yml

```
resources:
  Resources:
    ApiGatewayDeployment:
      Type: AWS::ApiGateway::Deployment
      Properties:
        RestApiId:
          Ref: ApiGatewayRestApi
        StageName: dev
        StageDescription:
          ThrottlingBurstLimit: 10
          ThrottlingRateLimit: 1

```

the throttling of my service still doesn’t change. So, I still need help with this.

---

<div class="post-metadata">

**Author:** ![esetnik](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/esetnik/32/3291_2.png) [@esetnik](https://forum.serverless.com/u/esetnik)\
**Post date:** [May 2, 2019, 9:36pm UTC](https://forum.serverless.com/t/throttling-a-service/2024/3 "2019-05-02T21:36:30Z")

</div>

Did you ever figure this out? I’m trying to override the dev stage throttle variables for a single method.

 ![15%20PM](https://canada1.discourse-cdn.com/flex036/uploads/serverless/original/2X/1/14631928bc72d05f36488e91b0a6f55abe4ba666.png)

---

<div class="post-metadata">

**Author:** ![DrNiels](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/drniels/32/2550_2.png) [@DrNiels](https://forum.serverless.com/u/DrNiels)\
**Post date:** [May 3, 2019, 7:24am UTC](https://forum.serverless.com/t/throttling-a-service/2024/4 "2019-05-03T07:24:07Z")

</div>

Unfortunately not. We’re going without throttling and it worked fine. So, I didn’t really get back to the topic. However, if you or someone else finds out, I wouldn’t mind implementing it as well.
