All Projects → DianaIonita → serverless-api-gateway-throttling

DianaIonita / serverless-api-gateway-throttling

Licence: ISC license
A plugin for the Serverless framework which configures throttling for API Gateway endpoints.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to serverless-api-gateway-throttling

Serverless Api Gateway Caching
A plugin for the Serverless framework which helps with configuring caching for API Gateway endpoints.
Stars: ✭ 92 (+70.37%)
Mutual labels:  api-gateway, serverless-framework, serverless-plugin
Serverless Es Logs
A Serverless plugin to transport logs to ElasticSearch
Stars: ✭ 51 (-5.56%)
Mutual labels:  api-gateway, serverless-framework, serverless-plugin
sls-photos-upload-service
Example web app and serverless API for uploading photos and saving to S3 and DynamoDB
Stars: ✭ 50 (-7.41%)
Mutual labels:  api-gateway, serverless-framework
amazon-ivs-ugc-web-demo
This repository shows how you can build a compelling user-generated content (UGC) live streaming webapp with Amazon IVS.
Stars: ✭ 14 (-74.07%)
Mutual labels:  api-gateway, serverless-framework
serverless-modular
⚡️ serverless plugin for microservice code management and deployment.
Stars: ✭ 19 (-64.81%)
Mutual labels:  serverless-framework, serverless-plugin
Serverless Aws Alias
Alias support for Serverless 1.x
Stars: ✭ 171 (+216.67%)
Mutual labels:  api-gateway, serverless-framework
CloudFrontier
Monitor the internet attack surface of various public cloud environments. Currently supports AWS, GCP, Azure, DigitalOcean and Oracle Cloud.
Stars: ✭ 102 (+88.89%)
Mutual labels:  api-gateway, serverless-framework
serverless-plugin-offline-kinesis-events
⚡ Serverless plugin that works with serverless-offline to allow offline testing of Serverless functions that are triggered by Kinesis events.
Stars: ✭ 15 (-72.22%)
Mutual labels:  serverless-framework, serverless-plugin
serverless
BlueNimble is a Hybrid Serverless Platform focusing on developer productivity and application portability. Create and run scalable APIs and applications without coding or by coding less. Focus on application business logic without any knowledge of the underlying microservices architecture.
Stars: ✭ 30 (-44.44%)
Mutual labels:  api-gateway, serverless-framework
serverless-certificate-creator
serverless plugin to manage the certificate of your lambdas custom domain (API Gateway=
Stars: ✭ 33 (-38.89%)
Mutual labels:  api-gateway, serverless-plugin
serverless-alexa-skills
Manage your Alexa Skills with Serverless Framework
Stars: ✭ 69 (+27.78%)
Mutual labels:  serverless-framework, serverless-plugin
Zappa
Serverless Python
Stars: ✭ 11,859 (+21861.11%)
Mutual labels:  api-gateway, serverless-framework
Serverless Next.js
⚡ Deploy your Next.js apps on AWS Lambda@Edge via Serverless Components
Stars: ✭ 2,977 (+5412.96%)
Mutual labels:  api-gateway, serverless-framework
serverless-content-encoding
Serverless plugin to enable content encoding for response compression
Stars: ✭ 14 (-74.07%)
Mutual labels:  api-gateway, serverless-plugin
Serverless Architectures Aws
The code repository for the Serverless Architectures on AWS book
Stars: ✭ 120 (+122.22%)
Mutual labels:  api-gateway, serverless-framework
noiiice
a serverless blog built on NuxtJS, AWS, serverless framework, and irrational exuberance.
Stars: ✭ 42 (-22.22%)
Mutual labels:  api-gateway, serverless-framework
Serverless Stack Demo Api
Source for the demo app API in Serverless-Stack.com
Stars: ✭ 486 (+800%)
Mutual labels:  api-gateway, serverless-framework
tencent-apigateway
Easily provision Tencent API Gateway using Serverless Components
Stars: ✭ 33 (-38.89%)
Mutual labels:  api-gateway, serverless-framework
serverless-fission
Use Fission through Serverless Framework https://serverless.com
Stars: ✭ 19 (-64.81%)
Mutual labels:  serverless-framework, serverless-plugin
serverless-aws-static-file-handler
Easily serve static files with the Serverless Framework on AWS Lambda.
Stars: ✭ 43 (-20.37%)
Mutual labels:  serverless-framework, serverless-plugin

serverless-api-gateway-throttling

CircleCI npm npm downloads

Intro

A plugin for the Serverless framework which configures throttling for API Gateway endpoints.

Why?

When you deploy an API to API Gateway, throttling is enabled by default. However, the default method limits – 10,000 requests/second with a burst of 5000 concurrent requests – match your account level limits. As a result, ALL your APIs in the entire region share a rate limit that can be exhausted by a single method. Read more about that here.

This plugin makes it easy to configure those limits. It supports both API Gateway v1 (REST API) and API Gateway v2 (HTTP API).

Good to know

  • if custom throttling settings are defined for an endpoint with HTTP method ANY, the settings will be applied to all methods: GET, DELETE, HEAD, OPTIONS, PATCH, POST and PUT.

How this plugin works

It configures endpoints in the gateway to override the settings they inherit from the stage. If you need reset all endpoints to inherit their settings from the stage again (as seen in this issue), you can do this:

sls reset-all-endpoint-settings

Examples

plugins:
  - serverless-api-gateway-throttling

custom:
  # Configures throttling settings for the API Gateway stage
  # They apply to all http endpoints, unless specifically overridden
  apiGatewayThrottling:
    maxRequestsPerSecond: 1000
    maxConcurrentRequests: 500

functions:
  # Throttling settings are inherited from stage settings
  update-item:
    handler: rest_api/item/post/handler.handle
    events:
      - http:
          path: /item
          method: post

  # Requests are throttled using this endpoint's throttling configuration
  list-all-items:
    handler: rest_api/items/get/handler.handle
    events:
      - http:
          path: /items
          method: get
          throttling:
            maxRequestsPerSecond: 2000
            maxConcurrentRequests: 1000

  # Requests are throttled for both endpoints
  get-item:
    handler: rest_api/items/get/handler.handle
    events:
      - http: # throttling settings are inherited from stage settings
          path: /item/{itemId}
          method: get
      - http:
          path: /another/item/{itemId}
          method: get
          throttling:
            maxRequestsPerSecond: 2000
            maxConcurrentRequests: 1000

  # Requests are throttled for both endpoints
  get-blue-item:
    handler: rest_api/items/blue/get/handler.handle
    events:
      - http:
          path: /item/blue/{itemId}
          method: get
          throttling:
            maxRequestsPerSecond: 300
            # maxConcurrentRequests are inherited from stage settings
      - http:
          path: /item/dark-blue/{itemId}
          method: get
          throttling:
            # maxRequestsPerSecond are inherited from stage settings
            maxConcurrentRequests: 300

  # Throttling is disabled for this endpoint
  list-more-items:
    handler: rest_api/items/get/handler.handle
    events:
      - http:
          path: /more-items
          method: get
          throttling:
            disabled: true
  
  # Also supports httpApi
  list-http-api-items:
    handler: rest_api/items/get/handler.handle
    events:
      - httpApi:
          path: /http-api-items
          method: get
          throttling:
            maxRequestsPerSecond: 3000
            maxConcurrentRequests: 1000
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].