1

我的serverless.yaml文件如下:

service: aws-python

provider:
  name: aws
  runtime: python2.7
  stage: beta
  region: us-east-1

package:
  include:
    - deps
    - functions
    - lib

functions:
  hello:
    handler: functions/handler.function_handler
    events:
      - http:
          path: ta
          method: GET
      - http:
          path: ta
          method: POST

我想将此 API 添加到使用计划中。这是怎么做到的?

4

2 回答 2

1

正如评论中提到的,Serverless 默认不支持这个。您应该考虑将适当的资源作为自定义资源添加到您的 CloudFormation 模板,或者使用 AWS CLI 或其他开发工具包创建它。

于 2016-09-26T15:38:38.977 回答
0

通过以下命令使用 AWS CLI

aws apigateway update-usage-plan --usage-plan-id <PLAN_ID> --patch-operations op=add,path=/apiStages,value=<API_ID>:<API_STAGE>
于 2016-09-27T09:39:18.460 回答