How To Set Your REST API’s Default Rate & Burst Throttling Limits

Setting the burst and rate throttling limits on an AWS API Gateway REST API’s Stage without any 3rd-party plugins using Serverless

Marco Lüthy
Geek Culture

--

Editing a Stage’s default method throttling limits in the AWS API Gateway Console. This is what we want to configure via Serverless.

In this article, we’ll look at how one can set the default method burst and rate throttling limits on an AWS API Gateway REST API’s Stage without using any 3rd-party plugins or dependencies. We’ll assume at least some familiarity with Serverless and AWS CloudFormation.

The Serverless Framework allows us to configure many settings through the provider section of a serverless.yml file. For example, you can configure the usage plan for your API which allows you to set request throttling limits on each API client (API key) you create. However, not all API Gateway settings are exposed by Serverless. Currently, two of these are the API Stage default method burst and rate throttling limits.

AWS API Gateway has two types of throttling-related settings (docs):

  1. Per-client throttling limits which are configured and applied through usage plans which provide API clients with API keys
  2. Global throttling limits which can be applied on a stage and affect all clients — often useful to prevent your API and account from being overwhelmed…

--

--

Marco Lüthy
Geek Culture

Hi there! I’m Marco. I write mostly about software development, sometimes about books I’ve read, and occasionally something else to keep things interesting.