I want to delete an Amazon Aurora cluster, but I received an error message. How can I troubleshoot this error and delete my cluster?

You can use the Amazon Relational Database Service (Amazon RDS) console or the AWS Command Line Interface (AWS CLI) to delete an Aurora cluster. For more information, see Deleting a DB Instance.

To delete an Aurora cluster, you must first delete all instances inside the cluster. After you delete all instances inside a cluster, you can then delete the cluster either by using delete-db-cluster, or by following these steps in the Amazon RDS console:

  1. Open the Amazon RDS console.
  2. Choose Clusters from the navigation pane, and then select the cluster.
  3. Choose Actions, and then choose Delete Cluster.
    Note: If Delete Cluster is gray or unavailable, there might be an instance inside the cluster that you need to delete.

Before deleting a cluster, consider the following:

  • If you have a cluster with only one instance and you delete that instance using the Amazon RDS console, then that instance and the cluster are both deleted.
  • If you have a cluster with one writer instance and one or more reader instance/read replicas, and you delete the reader instance, then the writer instance and the cluster are not affected. However, if you delete the writer instance, the reader instance is promoted as a writer. Then the reader instance fails over, which can cause downtime.

Deleting an Aurora cluster using the Amazon RDS console

If you receive an error when deleting an Aurora cluster, see the following error messages and troubleshooting steps to resolve the error:

InvalidDBClusterStateFault error

An error occurred (InvalidDBClusterStateFault) when calling the DeleteDBCluster operation: Cluster cannot be deleted, it still contains DB instances in non-deleting state.

This error occurs when the cluster that you're trying delete has at least one instance. First delete the DB instance, and then you can use delete-db-cluster to delete the cluster.

Cluster snapshot error

Cannot create the cluster snapshot because one with the identifier <abc-final-snapshot> already exists

If you delete the reader instance first and then delete the writer instance, you are prompted to take a final snapshot. After you enter a name for the final snapshot, Aurora backs up the DB cluster and then deletes the cluster.

If you have a single instance in the cluster and you try to delete the instance, Aurora prompts you to create a final snapshot. If you delete the instance and the cluster at the same time, and they share the same snapshot name, you might receive a cluster snapshot error. To resolve this error, enter a different name for the cluster's final snapshot, and then delete the cluster.

Client InvalidDBClusterStateFault error

A client error (InvalidDBClusterStateFault) occurred when calling the DeleteDBCluster operation: Cluster cannot be deleted, it still contains DB instances in non-deleting state.

or

Cannot delete the last instance of the read replica DB cluster. Promote the DB cluster to a standalone DB cluster in order to delete it.

If you replicate Amazon Aurora MySQL DB clusters across AWS Regions, you might receive this error. To delete the cross-region replica cluster, promote the read replica to be a standalone DB cluster, after which you can delete the cluster. Promoting the read replica and then deleting the cluster does not affect the source cluster.

Deleting an Aurora cluster using the AWS CLI

Create the cluster

To create a cluster, run a command similar to the following: 

aws rds create-db-cluster --db-cluster-identifier sample-cluster --engine aurora-mysql \
--engine-version 5.7.12 --master-username username --master-user-password password

Create an instance in the cluster

To create an instance in the cluster, run a command similar to the following:

aws rds create-db-instance --db-instance-identifier sample-instance \
--db-cluster-identifier sample-cluster --engine aurora-mysql --db-instance-class db.r4.large

Delete a DB instance without a final snapshot

To delete a DB instance without creating a final snapshot, run a command similar to the following:

aws rds delete-db-instance \
--db-instance-identifier sample-instance \
--skip-final-snapshot

Note: There is no output, even if this is the only instance in the cluster.

Delete a DB instance with a final snapshot

If you run the following command to delete a DB instance that is inside an Aurora cluster and then create a final snapshot, you receive an error. The following error occurs when you take a final snapshot for an instance that is inside a cluster, because you're required to take a cluster-level snapshot:

aws rds delete-db-instance \
--db-instance-identifier sample-instance \
--final-db-snapshot-identifier mydbinstancefinalsnapshot

Final snapshot error

An error occurred (InvalidParameterCombination) when calling the DeleteDBInstance operation: FinalDBSnapshotIdentifier can not be specified when deleting a cluster instance

Describe the current DB clusters

To describe the current DB clusters, run a command similar to the following:

aws rds describe-db-clusters

Delete the DB cluster

To delete a cluster, run a command similar to the following:

aws rds delete-db-cluster --db-cluster-identifier sample-cluster \
--final-db-snapshot-identifier mydbinstancefinalsnapshot

If there is at least one instance in the DB cluster that you're trying to delete, you receive the following error: 

An error occurred (InvalidDBClusterStateFault) when calling the DeleteDBCluster operation: Cluster cannot be deleted, it still contains DB instances in non-deleting state.

Delete DB cluster with a final DB snapshot

To delete a DB cluster and then create a final DB snapshot, run a command similar to the following:

aws rds delete-db-cluster --db-cluster-identifier sample-cluster \
--no-skip-final-snapshot \
--final-db-snapshot-identifier mydbinstancefinalsnapshot

Note: There is no output, even if there is no final-db-snapshot-identifier.

If there is already a DB cluster snapshot with the specified final-db-snapshot-identifier name, you receive the following error:

An error occurred (DBClusterSnapshotAlreadyExistsFault) when calling the DeleteDBCluster operation: Cannot create the cluster snapshot because one with the identifier mydbinstancefinalsnapshot already exists.

Delete a DB cluster without final DB snapshot

To delete a DB cluster without creating a final DB snapshot, run a command similar to the following:

aws rds delete-db-cluster --db-cluster-identifier sample-cluster \
--skip-final-snapshot

Note: There is no output if there are no instances on the cluster.


Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center

Published: 2016-05-26

Updated: 2018-09-18