Skip to content

Re-declare API Gateway stage throttling (200 rps / 100 burst) in code #210

Description

@gh-gate

Background

PR #209 dropped serverless-api-gateway-throttling (commit 4738a3b) because the plugin is unmaintained and incompatible with osls v4 (its post-deploy updateStage hook calls the removed provider.request() API and fails the deploy).

It had configured a default stage throttle:

apiGatewayThrottling:
  maxRequestsPerSecond: 200
  maxConcurrentRequests: 100

Problem

The plugin applied that throttle via a post-deploy API call, not CloudFormation. Because it's a sticky API Gateway stage setting, existing dev/prod stages keep the 200/100 limit - but it is no longer declared anywhere in the repo.

If a stage is ever recreated from scratch, the 200 rps / 100 burst throttle is gone and won't be reapplied; we'd fall back to account-level API Gateway limits only.

Task

Re-declare the stage-level default throttle in code so it survives a rebuild. Options to investigate:

  • Attach MethodSettings (ThrottlingRateLimit / ThrottlingBurstLimit) via a CloudFormation resources override. osls v4 emits no AWS::ApiGateway::Stage resource, so this may need a custom stage/deployment resource.
  • A maintained alternative plugin compatible with osls v4.

Verify with sls package that tables and ApiGatewayRestApi show UPDATE / no change (never REPLACE/DELETE) per the deploy guardrails in AGENTS.md.

Related: #209

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions