core: Order difference in Tags property is highlighted in cdk deploy --method=prepare-change-set
#26350
Labels
@aws-cdk/aws-elasticloadbalancing
Related to Amazon Elastic Load Balancing
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p2
Describe the bug
I am converting an existing CFN stack into CDK. The original stack template has
Tags
property in a resource.I wrote a CDK code like this to match the keys/values and their order.
I ran
cdk deploy --method=prepare-change-set
command to check if my code does not modify any resources in the existing stack. However, I got this diff entry in the change set.I checked the generated template from the CDK code.
The keys and values are the same but the order is different from the order in the code. I guess
CDK synth
automatically sorts the keys alphabetically.Expected Behavior
One of either options;
cdk synth
keeps the order of the key/value pairs when generating Tags property.cdk deploy --method=prepare-change-set
andcdk diff
does not highlight the order difference in Tags property.Current Behavior
The change set created by
cdk deploy --method=prepare-change-set
command shows the resource with the same tags asModify
resource.cdk diff
also shows thisReproduction Steps
cdk deploy --method=prepare-change-set
command with the following CDK codePossible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.85.0 and 2.87.0
Framework Version
No response
Node.js Version
v18.16.0
OS
Linux and MacOS (M1)
Language
Typescript
Language Version
Typescript(5.1.3)
Other information
No response
The text was updated successfully, but these errors were encountered: