New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWS API Gateway provider.apiGateway.stage not working #11675
Comments
FYI, I started a discussion for this but it's not getting any traction so I opened this issue. |
@mpage-hearsay thanks for reporting. Indeed it looks there's a bug, as PR with a fix is welcome! |
I would love to know if this was ever working? Seems like the code change made in October was quite simple. I am also facing this issue & trying to debug how/where it is going wrong |
As I checked, it didn't, see my comment in original PR |
oh sorry! are we able to mention that PR here. This would be quite a crucial feature for a new SaaS application I was building based off the assumption that this was functional 😞 Happy to help but I currently do not know where to start haha 😢 |
@medikoo a question I have about the fix. What if the API Gateway stage already exists? Will the SLS deploy overwrite an existing stage with the given name? I ask because we have stages/resources/methods that are defined/managed outside of serverless. In certain cases I want my serverless app to just add resources/methods to the existing gateway stage. |
Such a scenario should only be taken into account if service references an external API Gateway, then I believe updates done via AWS SDK are not considered at all (as we do not allow updating API-wide properties when we work with externally defined API) and when endpoints setup in CF are considered it is safe to define stage deployment (it won't break other endpoints deployments made to the same stage from eventual another stack) |
Would be nice to see this work for ApiGatewayV2 as well. Something like: provider:
apiGateway:
stage: customStageName As a work around it seems to work if you add some partial content to the Resources section: Resources:
HttpApiStage:
Type: AWS::ApiGatewayV2::Stage
Properties:
"StageName": "customStageName" |
the workaround here is confirmed to work. just make sure it's under resources like so resources:
Resources:
HttpApiStage:
Type: AWS::ApiGatewayV2::Stage
Properties:
"StageName": "customStageName" |
We have been using the following syntax and it's been working fine. Stage is at
|
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
I am trying to override the AWS API Gateway Stage name as described here.
However, when I deploy it doesn't create a stage with the overridden name value. It still defaults to using the Serverless stage name for the new API Gateway Stage.
These are the URLs I see in the deployed API Gateway Stage(s):
Instead I want to have:
Service configuration (serverless.yml) content
Command name and used flags
sls deploy --stage dev
Command output
Environment information
Running "serverless" from node_modules Framework Core: 3.25.1 (local) 3.26.0 (global) Plugin: 6.2.2 SDK: 4.3.2
The text was updated successfully, but these errors were encountered: