Throttling a service

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?

1 Like

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.

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

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.