是否可以在无服务器中为AWS Api Gateway的每个api密钥创建使用计划?

问题描述 投票:4回答:1

official docs中,只有具有API密钥列表和一个使用计划的默认配置。所有API密钥均已连接到该单一使用计划。

是否可以为无服务器框架中的每个API密钥配置单独的使用计划?

aws-api-gateway serverless-framework
1个回答
0
投票

现在,它可以作为零件配置使用,并在here中进行了详细说明>

service: my-service
provider:
  name: aws
  apiKeys:
    - free:
        - myFreeKey
        - ${opt:stage}-myFreeKey
    - paid:
        - myPaidKey
        - ${opt:stage}-myPaidKey
  usagePlan:
    - free:
        quota:
          limit: 5000
          offset: 2
          period: MONTH
        throttle:
          burstLimit: 200
          rateLimit: 100
    - paid:
        quota:
          limit: 50000
          offset: 1
          period: MONTH
        throttle:
          burstLimit: 2000
          rateLimit: 1000
functions:
  hello:
    events:
      - http:
          path: user/create
          method: get
          private: true
© www.soinside.com 2019 - 2024. All rights reserved.