(cli): cdk diff pessimizes replacement if expression changes #21164
Labels
@aws-cdk/core
Related to core CDK functionality
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p2
Describe the bug
I am trying to use
cloudformation_include
to import a serverless framework deployed RDS stack into the CDK v2.25.0. I followed the instructions in this article https://snow-dev.com/posts/migrate-from-serverless-to-cdk.htmlHowever, when I do a
cdk diff
on this I seem to get an indication that the DB will be replaced, i.e. I get this within the output:The template JSON file that I supplied defines the DatabaseName as:
It looks like the CDK synthesises this as:
which (I think) then causes it to incorrectly believe that the RDS will need to be redeployed.
If I run
cdk deploy
it correctly preserves the RDS. So it looks like it is onlycdk diff
that is reporting this incorrectly.Expected Behavior
I expected
cdk diff
to not report that the RDS will be replaced.Current Behavior
cdk diff
incorrectly reports that the RDS will be replaced (as described above). However,cdk deploy
behaves correctly in that it preserves the existing RDS and all the data within it.Reproduction Steps
All details are provided above.
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.25.0
Framework Version
No response
Node.js Version
v14.17.5
OS
macOS Monterey Version 12.4
Language
Typescript
Language Version
TypeScript v4.6.4
Other information
Originally reported in cdk slack channel - https://cdk-dev.slack.com/archives/C018XT6REKT/p1657784736307229
Adam Ruka said this in this slack channel:
I've seen this with
Fn::Select
before, and we fixed it in #19680, but looks like we need to do the same forFn::Split!
The text was updated successfully, but these errors were encountered: