Skip to content
Advertisement

Adding API to Usage Plan using Serverless Framework

My serverless.yaml file is as follows:

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

I want to add this API to a Usage Plan. How is this done?

Advertisement

Answer

Used the AWS CLI with the following command

aws apigateway update-usage-plan --usage-plan-id <PLAN_ID> --patch-operations op=add,path=/apiStages,value=<API_ID>:<API_STAGE>
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement