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

ignore drift in rds.Cluster and rds.Instance due to engine_version diff arising out of automanaged upgrades #1514

Conversation

ravilr
Copy link
Contributor

@ravilr ravilr commented Oct 8, 2024

Description of your changes

Fixes #1504

RDS DB Cluster and Instance resources configured with autoMinorVersionUpgrade: true will have RDS managed service upgrade the DB cluster/instances automatically to new available minor/patch versions during the configured preferred maintenance window. the provider-upjet-aws-rds controller currently, detects this auto version upgrade as a drift from the desired spec (if the spec.forProvider.engineVersion is specified in the resource spec) and ends up doing an endless diff and update cycle, resulting in exhaustion of the RDS API calls quota. AWS RDS doesn't allow engine version downgrades. So the update calls keep getting returned with error.

This change customizes the terraform InstanceDiff for Cluster and Instance rds resources to account for the above automanaged upgrades by ignoring the engine version diff, if the desired spec version is lower than the external's actual version.

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • [ ] Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

  • unit tests
  • Manually tested by:
    • created a rds cluster Cluster.rds.aws.upbound.io managed resource with spec.forProvider.engine_version: 8.0.mysql_aurora.3.06.1 with autoMinorVersionUpgrade: true
    • Instead of waiting for the RDS Managed service to auto upgrade to latest 8.0 release version during the next maintenance window, manually upgraded the engine_version in RDS Console/UI to 8.0.mysql_aurora.3.07.1. the database cluster engine version gets updated successfully.
    • verified the cluster.rds managed resource remains synced: True, without any previous endless drift->update cycle behavior.

Credits: this is reusing the engine version util code from crossplane-contrib/provider-aws#1765

…ff arising out of automanaged upgrades

Signed-off-by: ravilr <[email protected]>
@ravilr ravilr force-pushed the rds_prevent_drift_due_to_automanaged_upgrades branch from cafd8e7 to c3547fb Compare October 8, 2024 22:07
@turkenf
Copy link
Collaborator

turkenf commented Oct 9, 2024

/test-examples="examples/rds/v1beta1/instance.yaml"

@turkenf
Copy link
Collaborator

turkenf commented Oct 9, 2024

/test-examples="examples/rds/v1beta1/cluster.yaml"

Copy link
Collaborator

@turkenf turkenf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @ravilr, LGTM 🙌

@turkenf turkenf merged commit 9cd7c62 into crossplane-contrib:main Oct 10, 2024
13 checks passed
@ravilr ravilr deleted the rds_prevent_drift_due_to_automanaged_upgrades branch October 11, 2024 07:09
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.

[Bug]: Auto minor version upgrades causes drifts in configuration
2 participants