- Newest
- Most votes
- Most comments
I apologize for the inconvenience you're experiencing with your MemoryDB cluster. Unfortunately, there isn't a direct way to force-delete a MemoryDB cluster that's stuck in the "creating" state. The error message you're receiving indicates that the cluster is in an invalid state for deletion, which is a safeguard to prevent data loss or inconsistencies.
In this situation, the best course of action is to contact AWS Support. They have the tools and permissions necessary to investigate and potentially force the deletion of the stuck cluster. AWS Support can also help diagnose the root cause of the issue, which seems to be related to the parameter group mismatch you mentioned.
While waiting for AWS Support's assistance, here are a few things you can try, although they may not resolve the issue:
- Wait for some time (a few hours) to see if the cluster state changes on its own.
- Try updating the cluster configuration, if possible, through the AWS CLI or SDK. This might trigger a state change.
- Attempt to create a final snapshot of the cluster before deletion, which sometimes can help transition the cluster to a deletable state.
Regarding the parameter group mismatch you mentioned (selecting default.memorydb-valkey7 instead of default.memorydb-valkey7.search), this is indeed an important observation. It's possible that this mismatch is preventing the cluster from fully initializing. In the future, ensure that you select the correct parameter group that matches your MemoryDB engine version and intended use case.
For the Terraform issue you're experiencing as a result of this stuck cluster, you may need to temporarily remove the MemoryDB resource from your Terraform configuration and manually delete it (with AWS Support's help) before re-adding it to your Terraform state.
Again, the most effective solution in this case would be to reach out to AWS Support for assistance in force-deleting the stuck cluster and investigating the root cause of the issue.
Sources
delete-cluster — AWS CLI 2.26.2 Command Reference
Getting started with MemoryDB - Amazon MemoryDB
DeleteCluster - Amazon MemoryDB
Relevant content
- asked 2 years ago
- asked 2 years ago
Telling me to "wait a bit" is not unacceptable -- the cluster took 9 hours (!) to finally reach an error state, report snapshot restore had failed and allow itself to be deleted.
And repeating my own find at me ("In the future, ensure that you select the correct parameter group that matches your MemoryDB engine version and intended use case.") is beyond useless.