AWS API 网关错误 - [429] 已达到此 API 的最大请求验证器数量

问题描述

我正在为我的 API 使用 AWS API Gateway 请求验证功能。您可以在文档 here 中查看更多详细信息。 为了部署 API,我使用了无服务器框架。以下是 serverless.yml 的片段。

resources:
  Resources:
    ParameterRequestValidator:
      Type: AWS::ApiGateway::RequestValidator
      Properties:
        Name: ParameterRequestValidator
        RestApiId:
          Ref: ApiGatewayRestApi
        ValidateRequestBody: true
        ValidateRequestParameters: false

端点由 lambda 函数支持,定义如下:

functions:
  configs-create:
    handler: src.handlers.configs.create.handler
    events:
      - http:
          path: /configs
          method: post
          cors: true
          reqvalidatorName: ParameterRequestValidator
          request:
            schema:
              application/json: ${file(src/handlers/schemas/config_create.json)}

截至目前,我有 8 个实体,每个 REST 方法有 5 个端点 - POST、GET ID、GET All、PUT、PATCH。其中,请求验证器已附加到方法 POST、PUT 和 PATCH。因此,总共有 24 个端点使用请求验证器。

在运行无服务器部署时,我收到以下错误消息:

Serverless Error ---------------------------------------

  An error occurred: ApiGatewayMethodMeasurementDashlocationsIdVarPutValidator - Maximum number of Request Validators for this API has been reached. (Service: AmazonApiGateway; Status Code: 429; Error Code: LimitExceededException; Request ID: xxxx; Proxy: null).

Quotas Documentation 页面没有提到对请求验证器数量的具体限制。 另外,我打算有更多的方法,但是,似乎我已经使用请求验证器达到了 24 个函数的限制。

如何绕过此限制并确保无服务器部署命令不会失败?另外,有人知道允许使用多少个请求验证器吗?

非常感谢您的帮助! 提前致谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)