Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(DBCluster): fix local write forwarding error on cluster update (c… #563

Conversation

kylenie-aws
Copy link
Contributor

This is a continuation for PR #552 which to fix an issue causing resource updates to fail with a "Local Write Forwarding is already disabled/enabled on cluster" error.

This issue occurs because RDS validates the enableLocalWriteForwarding variable and will throw an exception if it is already disabled/enabled but still receives the same value in the modify request. PR #552 introduced a fix to set enableLocalWriteForwarding in the modify request only when this property is actually changing in the CFN template. However, there are two issues remaining:

  1. Transforming the property from null -> false still encounters an 'already disabled' exception because CFN passes false to the modify request when the status is already false.
  2. Transforming the property from true -> null fails to update the LocalWriteForwarding status to disabled. This occurs because CFN passes null to the modify request, which results in RDS not updating the status.

This fix did the following:

  1. Explicitly set enableLocalWriteForwarding: null when the property is from null -> false, allows RDS to retain the status as false without throwing an exception."
  2. Explicitly set enableLocalWriteForwarding: false when the property is from true -> null, forces RDS to update the status to false.

Below is the truth table after the fix:

PreviousCFNValue DesiredCFNValue ValueInModifyRequest CurrentDBClusterState DesiredDBClusterState
null null null false false
true null false true false
false null null false false
null true true false true
true true null true true
false true true false true
null false null false false
true false false true false
false false null false false

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@kylenie-aws kylenie-aws added this pull request to the merge queue Aug 6, 2024
Merged via the queue into aws-cloudformation:master with commit 7add608 Aug 6, 2024
1 check passed
@kylenie-aws kylenie-aws deleted the cont-pr-552-fix-local-write-forwarding branch August 6, 2024 23:34
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.

2 participants