You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched existing issues, it hasn't been reported yet
Issue description
When deploying a REST API with a usage plan, the generated usage plan template attempts to reference the provider.stage parameter, instead of provider.apiGateway.stage (when configured).
This results in an error when deploying the stack.
Serverless.yml configuration:
provider:
name: awsruntime: nodejs18.xapiGateway:
stage: api-2 # this is the part that gets ignoredusagePlan:
throttle:
burstLimit: 500rateLimit: 1000
Resulting UsagePlan resource:
"ApiGatewayUsagePlan": {
"Type": "AWS::ApiGateway::UsagePlan",
"DependsOn": "ApiGatewayDeployment1707470569325",
"Properties": {
"ApiStages": [
{
"ApiId": {
"Ref": "ApiGatewayRestApi"
},
"Stage": "dev"// `dev` stage is referenced even though `api-2` is set as the apiGateway stage
}
],
"Description": "Usage plan for usage-plan-repro dev stage",
"UsagePlanName": "usage-plan-repro-dev",
"Throttle": {
"BurstLimit": 500,
"RateLimit": 1000
}
}
}
Root cause seems to be that usage-plan.js uses that.provider.getStage() to set the stage, instead of this.provider.getApiGatewayStage().
Are you certain it's a bug?
Is the issue caused by a plugin?
Are you using the latest v3 release?
Is there an existing issue for this?
Issue description
When deploying a REST API with a usage plan, the generated usage plan template attempts to reference the
provider.stage
parameter, instead ofprovider.apiGateway.stage
(when configured).This results in an error when deploying the stack.
Serverless.yml configuration:
Resulting UsagePlan resource:
Root cause seems to be that
usage-plan.js
usesthat.provider.getStage()
to set the stage, instead ofthis.provider.getApiGatewayStage()
.I will submit a PR with a fix.
Service configuration (serverless.yml) content
Command name and used flags
serverless deploy
Command output
Environment information
The text was updated successfully, but these errors were encountered: