apigateway: Cannot rename resource without tearing down whole gateway #25172
Labels
@aws-cdk/aws-apigateway
Related to Amazon API Gateway
closed-for-staleness
This issue was automatically closed because it hadn't received any attention in a while.
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Describe the bug
I think this is really an issue with CloudFormation, but I'm experiencing it with CDK.
Like described here: serverless/serverless#3785
When I rename a resource with a variable path in my CDK stack, the next deployment will always fail with a
A sibling of this resource already has a variable path part
. Presumably because CDK/CF are trying to create a new resource before deleting the old one.I get that this is desired behavior in some cases, but I want the inverse. Delete the existing endpoint first, and then create a new one. I don't think this is something that I should have to manually do by tearing down the whole stack (or at least, whatever part of the API contains the resource) only to re-deploy with the new resource added.
Expected Behavior
I expect to be able to change a resource name from variable to fixed, fixed to variable or variable to catch-all without CDK/CF failing.
Current Behavior
When a resource has it's name changed from variable to fixed, fixed to variable or variable to catch-all, the stack fails to deploy.
Reproduction Steps
to
Possible Solution
I think a way of indicating that you are fine with resources being deleted before being created is fine. This might break your API for a little bit, but since you are already renaming endpoints, this shouldn't be the end of the world.
Additional Information/Context
No response
CDK CLI Version
2.65.0 (build 5862f7a)
Framework Version
No response
Node.js Version
v18.11.0
OS
MacOS Ventura 13.2.1 (22D68)
Language
Typescript
Language Version
4.9.5
Other information
No response
The text was updated successfully, but these errors were encountered: