Here’s a bit of yml where I’m trying to create a usage plan and associate it with a stage:
Type: "AWS::ApiGateway::UsagePlan"
DependsOn: CasApiGateway
Properties:
UsagePlanName: ${self:service}-${self:provider.stage}
Description: ${self:service} usageplan for ${self:provider.stage}
ApiStages:
- ApiId:
Ref: CasApiGateway
Stage: ${self:provider.stage}
For deploying to a new stage, it doesn’t work. I get the following error:
An error occurred: DefaultServiceUsagePlan - API Stage not found: ylml49tsq4:dev (Service: AmazonApiGateway; Status Code: 404; Error Code: NotFoundException; Request ID: 990af856-f981-4097-935c-062e4d9201b7)
If I comment out the ApiStages section, it will deploy successfully, but there’s no API Stage associated. If I then uncomment the ApiStages section and redeploy it will work and have the API Stage associated. I’m sure I’m missing something here, but how do I get the ApiStages associated correctly on the first deploy?? Thanks!!