gruntwork-io/cloud-nuke

Error Deleting RDS Cluster

Closed this issue · 6 comments

Example:

| testlptb40-1                                                                        | RDS Cluster                      | ❌ InvalidGlobalClusterStateFault: Unable t |

Unable to delete certain RDS clusters in phxdevops.

Full error: [Failed] testlptb40-1: InvalidGlobalClusterStateFault: Unable to delete cluster that is a primary member of global cluster while there are other global cluster members

  • Need to delete all the replica cluster first
  • Then delete the primary cluster
  • Then delete the global cluster

E.g.,

image

Order of operation is quite complicated.

  • Need to remove association with global cluster before deleting all clusters.
  • The order of cluster deletion is quite important. I don't think we can delete cluster by cluster per region. Sometimes order of which cluster to delete in different regions matter.

We should make the RDS cluster a global resource, rather than regional resource. Or alternatively, we can create another resource type that handles deleting resources across regions (e.g., global resource)

After removing global cluster from secondary cluster, I was able to trigger deletion.
However, I'm still having trouble deleting primary cluster. Here is an issue:

Cannot delete the last instance of the master cluster. Delete the replica cluster before deleting the last master cluster instance.

image

Not sure how we can continue the deletion in this setup.

If there's no associated cluster, we can delete global cluster without any problem.

image

The error message does not make sense because there's no READ cluster attached to the global cluster.

Cannot delete the last instance of the master cluster. Delete the replica cluster before deleting the last master cluster instance.