-
Notifications
You must be signed in to change notification settings - Fork 4k
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
api-gateway: Allow to use an existent stage for deployments #25582
api-gateway: Allow to use an existent stage for deployments #25582
Comments
Yes, being allowed to deploy using the existing stage would be great! Thank you for your detailed feature request and we appreciate your PR. |
@pahud Thanks for the quick response - I am happy to help/submit a PR with a proposal to implement this :) |
Any update on this? I'm also keen for this to be implemented. Is the currently agreed workaround to still bypass the typescript type of the deployment construct? |
Any Updates? |
Also eagerly waiting for this feature, currently my only option is redeploying the existing stage using the aws client which is far from ideal. |
I would like to see this feature as well. Has there been any movement on this topic? |
I've also encountered a need for this feature. |
Hello all, Please help us prioritize this feature request by upvotes 👍 on the issue description. According to our contributing guide, any P2 issue with 20 or more +1s will be automatically upgraded from P2 to P1 and we welcome community PRs as well. |
This issue has received a significant amount of attention so we are automatically upgrading its priority. A member of the community will see the re-prioritization and provide an update on the issue. |
### Issue # Closes #25582 . ### Reason for this change If I have to manually create a new deployment for API gateway but want to deploy to an existing stage instead of creating a new stage, the current workaround is `(deployment as any).resource.stageName = "myStage";` ### Description of changes Added a new property `stageName` to `Deployment`. Updated README with two new sections: `Deploying to an existing stage` and `Controlled triggering of deployments` to show how users can trigger new deployments with their latest API changes if they manually create a `Deployment` resource for RestApi. Since `RestApiBase` manages `Deployment` constructs, this change applies to both `SpecRestApi` and `RestApi`. ### Description of how you validated changes Added unit tests and integration tests. Also successfully deployed a sample app to my account where I created a stage in the API gateway console and specified the stage name in the new deployment. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Describe the feature
Ability to specify existent environments name when creating a new deployment for an API Gateway.
Currently is possible to do that bypassing cdk lib type definition using the suggestion specified here https://stackoverflow.com/questions/63950199/how-to-use-an-existing-stage-in-api-gateway-deployments-in-aws-cdk
See more information here: https://stackoverflow.com/questions/63950199/how-to-use-an-existing-stage-in-api-gateway-deployments-in-aws-cdkenvironment
Use Case
When you have a central API Gateway and multiple other APIs/resources defined in other stacks/repo, we want to be able to deploy it to an "existent" stage without having to create/replace a new one.
/resource-A
-> points to an external resources defined by an externalStack-A
/resource-B
-> points to an external resources defined by an externalStack-B
.I want to be able to re deploy
Stack-A
andStack-B
and also create a new deployment for an existent environment - the current options on CDK Constructs doesn't allow to easily do that and suggest creating a new stage by usingnew Stage
as define here https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.Deployment.html.
Proposed Solution
A property in the deployment construct to use an existent schema (either by stageName or an
IStage
interface)This is the current way of doing that and I can confirm it works:
I also considered trying to assign a stage to the rest api construct, but the deployment Stage expects a
Stage
object and doesn't not acceptIStage
.Other Information
No response
Acknowledgements
CDK version used
"aws-cdk-lib": "^2.42.1",
Environment details (OS name and version, etc.)
MacOS
The text was updated successfully, but these errors were encountered: