serverless-api-stage icon indicating copy to clipboard operation
serverless-api-stage copied to clipboard

Deployment fails when using usage

Open pchynoweth opened this issue 6 years ago • 1 comments

I am using a usagePlan together with method level throttling. I get an error like this when I attempt to deploy:

  Serverless Error ---------------------------------------
 
  An error occurred: ApiGatewayUsagePlan - API Stage not found: ...

The issue is actually racy. Sometimes deploy succeeds. It appears to happen because the rules created for both AWS::ApiGateway::UsagePlan and AWS::ApiGateway::ApiKey expect the deployment to create the stage. To this end they both depend on the deployment but they should actually depend on the stage.

I have a proposed fix for this and will follow up with a PR.

pchynoweth avatar Feb 03 '19 14:02 pchynoweth

Hello I have the same issue and I solved it here https://github.com/leftclickben/serverless-api-stage/pull/25 I have test yours and also works but I had issues when I wanted to use domain manager plugin if you could give it a test to the change I propose I would really appreciate it, thank you

KikeMendez avatar Feb 23 '19 00:02 KikeMendez