Skip to content

Unable to deploy APIGateway - An error occurred: ApiGatewayUsagePlan - API Stage not found #28

@cyrdlg

Description

@cyrdlg

This plugin seems to screw up the way APIGateway is deployed and prevents CloudFront from deploying the pile properly when an apiKey is required in serverless.yml.

serverless.yml :

service:
  name: serviceName

provider:
  name: aws
  runtime: nodejs8.10
  apiKeys:
    - api-key

functions:
  hello:
    handler: handler.hello
    timeout: 15
    events:
      - http:
          path: hello
          method: post
          private: true

This works fine and deploys without a hiccup.

serverless.yml :

service:
  name: serviceName

custom:
  env_var: ${env:USER}-hello
  stageVariables:
    envVar: ${self:custom.env_var}

provider:
  name: aws
  runtime: nodejs8.10
  apiKeys:
    - api-key

functions:
  hello:
    handler: handler.hello
    timeout: 15
    events:
      - http:
          path: hello
          method: post
          private: true

plugins:
  - serverless-plugin-stage-variables

This does not deploy at all, serverless sends back the following error : An error occurred: ApiGatewayUsagePlan - API Stage not found

Going deeper into cloudFormation logs, it seems that the deployment sequence of APIGateway gets awry and fails when CloudFormation tries to create a UsagePlan at the same time as the API Stage.

Using serverless :
Framework Core: 1.59.3
Plugin: 3.2.5
SDK: 2.2.1
Components Core: 1.1.2
Components CLI: 1.4.0

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