Closed fongie closed 3 years ago
Apologies for the long delay on response here. This is standard CloudFormation behavior for updates: old/existing resources are never deleted until the updates/creations have finished. This is so your stack can maintain consistency; if old resources were deleted first, you'd end up in the situation where -- for some time period -- you had no resources in the stack, which could cause outages or other unexpected issues.
In cases like this, a workaround is to change some other property of the resource so they don't look identical to WAF, then undo that change in a subsequent deployment. It's not the smoothest, but will work around "refactorings" like this. Sorry to not have a better answer.
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
The logical id changed on my regex pattern, and cdk diff specifies that it is removing the old logical id and creating a new one (they are in fact identical though). On deploy, Cloudformation begins by creating the new pattern which resulted in
but it should have first destroyed the old one and then recreated the new one. The order of destroy/create seems to be wrong here.
Reproduction Steps
My code initially looked like this:
I refactored it to this
As you can see, I did end up changing the CDK
id
prop with this, which is why the logical id changed (I assume).cdk diff now shows
What did you expect to happen?
I expected the deployment to first destroy the old pattern and then create the new one. Now, I need to recreate the stack completely.
What actually happened?
see the error above
Environment
Other
This is :bug: Bug Report