I'm using boto3 in a small script to change the master credentials of an RDS cluster.
The issue is that the RDS cluster status from describe_db_clusters isn't reliably up to date. After I issue a modify_db_cluster (specifically, I'm updating the master password), there is a high chance that describe_db_clusters shows that the cluster is still "available", before it enters the "modifying" state.
The sequence of events:
- cluster is available
- modify cluster password
- cluster is still available
- cluster is modifying
- cluster is available (operation complete)
The issue is that I can't reliably tell between states 3 and 5.
Notes:
- I'm using
ApplyImmediately=Truefor the master password update - I see the same problematic behaviour, whether I inspect the cluster status, or the cluster's
PendingModifiedValues
The docs do mention this for describe_db_instances:
MasterUserPassword (string) -- The new password for the master user. The password can include any printable ASCII character except "/", """, or "@". Changing this parameter doesn't result in an outage and the change is asynchronously applied as soon as possible. Between the time of the request and the completion of the request, the MasterUserPassword element exists in the PendingModifiedValues element of the operation response.
However, that footnote doesn't exist for describe_db_clusters.
How can I reliably know when my modification operation is complete?