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

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

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. 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

Setting the burst and rate throttling limits on an AWS API Gateway REST API’s Stage without any 3rd-party plugins using 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 by too many requests

There are a few Serverless plugins which let you set the stage default throttling limits, but they don’t appear to be actively maintained. Moreover, when it comes to infrastructure deployment, I’m generally mistrusting of 3rd-party libraries including Serverless plugins which muck about with the resources that get provisioned during deployment. For example, through a plugin update, a malicious developer could sneak in code which provisions AWS resources on subsequent deployments after the update is installed — all without us even being aware of it. No good. So, I tend to avoid Serverless plugins.

Luckily, Serverless lets us add our own custom CloudFormation configuration in the resources  section of any project’s Serverless configuration file. This lets us control settings which go beyond what Serverless supports out of the box.

In the rest of this article, we’ll look at how we can set the Stage default burst and rate throttling limits via the serverless.yml's resources section without requiring any 3rd-party dependencies.

serverless aws api-gateway devops

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Serverless Proxy with AWS API Gateway and AWS Lambda

Serverless Proxy with AWS API Gateway and AWS Lambda. We can communicate between Public and Private instance via a Serverless Proxy thanks to AWS Api Gateway and AWS Lambda. Github Webhook calls a Public API Gateway, API Gateway triggers a Lambda attached to VPC.

Serverless Express – Easy APIs On AWS Lambda & AWS HTTP API

Serverless Express enables you to easily host Express.js APIs on AWS Lambda and AWS HTTP API. Here is how to get started and deliver a Serverless Express.js based API with a custom domain, free SSL certificate and much more!

Build a Serverless API with AWS Gateway and Lambda

In this article, we explain general API implementation concepts using AWS Lambda and other AWS services. APIs are a crucial part of any web application and there are different techniques for development and design. Serverless is one approach gaining popularity, because of its cost-efficiency, scalability and relative simplicity. As a leading serverless provider, Amazon Web Services (AWS) has made a huge contribution to the world of serverless development, and in this article, we will explain general API implementation concepts using AWS Lambda and other AWS services.

How To Unite AWS KMS with Serverless Application Model (SAM)

AWS KMS is a Key Management Service that let you create Cryptographic keys that you can use to encrypt and decrypt data and also other keys. You can read more about it here.

Serverless APIs with Python, AWS Lambda & API Gateway

Serverless APIs with Python, AWS Lambda & API Gateway