Skip to content

Conversation

@leonmk-aws
Copy link
Contributor

Fixes #2248

Description of the bug

When checking for the database diff, the eventRootProperty and eventResourcesField of events were shown as changing like:

│          ├[~]  event aws.autoscaling@EC2InstanceLaunchLifecycleAction
│          │  └      - rootProperty: EC2InstanceLaunchLifecycleAction
│          │         + rootProperty: EC2InstanceLaunchLifecycleAction
│          │         - resourcesField: [EC2InstanceLaunchLifecycleAction.AutoScalingGroupName]
│          │         + resourcesField: [EC2InstanceLaunchLifecycleAction.AutoScalingGroupName]

This was caused because they used JsonEq for comparison, which also checked if they has the same $id in the db, which is not always true (e.g. when adding a new resource to the db, ids will change).

Solution

Do not compare the ids, but use the existing functions to compare the EvenTypeDefinition in these properties.

Testing

  • Ran the diff script on databases where the ids had changed, diff is now correct.
  • Added a unit test

@github-actions
Copy link
Contributor

@aws-cdk/aws-service-spec: No model change detected

@cdklabs cdklabs deleted a comment from github-actions bot Nov 27, 2025
@aws-cdk-automation aws-cdk-automation added this pull request to the merge queue Nov 27, 2025
Merged via the queue into main with commit 0cf2e13 Nov 27, 2025
10 checks passed
@aws-cdk-automation aws-cdk-automation deleted the event-diff branch November 27, 2025 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Events diff is always showing

3 participants