- Newest
- Most votes
- Most comments
As you already mentioned that for REST APIs with a large number of Resources and Methods which hits the CloudFormation limit of 500 resources per stack, it is suggested to implement nested stacks in order to divide the resources among the multiple child stacks
Now, in order to get the new or updated methods deployed in additon to the deletion of the older or deprecated methods, it is required to update the definition of the cdk application to allow the deletion of the older versions of method deleted during cleanup of the stack resources once the new resources have been deployed successfully.
However, in case these methods have been deleted manually as an out of band change to the cdk application, it is suggested to update the definition of the resource to avoid the drift among the resources. With this, we can ensure that cdk will try to compare the difference between the methods in the new deployments compared with the last deployment.
Relevant content
- asked a year ago
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 8 months ago
Thank you for your reply.
I am not sure to understand exactly what you mean by "it is required to update the definition of the cdk application" I understand the remove or deprecated methods can be removed during the cleanup phase.
Let's take the exemple from the documentation with books and pets API. Let's say I want to remove the books API. I would remove the code regarding BooksStack and I would write new DeployStack(this, { restApiId: restApi.restApiId, methods: petsStack.methods, });
Then I redeploy. The books method are removed from the resource tab in the aws gateway console but not from the stage tab.
What do I need to do in addition to update the definition of the cdk application ?
+1 to Bruno's question - the proposed answer to this is not explicit enough. Please elaborate.