Question: How can I troubleshoot an error that I received when deleting an Amazon Aurora cluster?

I want to delete an Amazon Aurora cluster, but:I received an error message.        - or -The option to delete is unavailable (grayed out) in the Amazon Relational Database Service (Amazon RDS) console.How can I troubleshoot this issue and delete my cluster?Short descriptionYou can use the Amazon RDS console or the AWS Command Line Interface (AWS CLI) to delete an Amazon Aurora cluster. For more information, see Deleting a DB instance.To delete an Aurora cluster using the AWS CLI, first delete all DB instances inside the cluster. After you delete all DB instances inside a cluster, you can then delete the cluster by using delete-db-cluster. If you delete the last DB instance in the cluster using the Amazon RDS console, the empty cluster is automatically deleted.

ResolutionNote: If you receive errors when running AWS CLI commands, make sure that you’re using the most recent version of the AWS CLI.Before deleting a cluster, consider the following:If you have a cluster with only one DB instance and you delete that DB instance using the Amazon RDS console, then delete both that DB instance and the cluster.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 aren’t affected. If you delete the writer instance, then the reader instance is promoted as a writer, automatically. This failover operation causes downtime.Delete an Aurora cluster with no instances inside it using the Amazon RDS consoleFollow these steps in the Amazon RDS console:Open the Amazon RDS console.Choose Databases from the navigation pane, and then select the cluster.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 must delete. In this case, delete all the instances in the cluster. When you delete the last instance in the cluster using the Amazon RDS Console, then the cluster is deleted automatically.If you receive the following error, then follow the steps below."This database has deletion protection option enabled, to be able to delete the last Aurora DB instance, modify the Aurora cluster and disable deletion protection"Open the Amazon RDS console.Choose Databases from the navigation pane, and then select the cluster.Choose Actions, and then choose Modify Cluster.Choose Disable deletion protection, and then choose Continue.Choose Apply immediately.Delete an Aurora cluster using the AWS CLINote: The following steps are applicable for both Aurora MySQL and Aurora PostgreSQL.1.    Delete an Aurora clusterRun the following command:aws rds delete-db-cluster --db-cluster-identifier sample-cluster --final-db-snapshot-identifier mydbinstancefinalThis command deletes the cluster, and takes the final DB cluster snapshot. If you don't want to take the final snapshot, use the ---skip-final-snapshot option when you run this command. You might receive the following error when you run this command:"An error occurred (InvalidDBClusterStateFault) when calling the DeleteDBCluster operation: Cluster cannot be deleted, it still contains DB instances in non-deleting state"This indicates that the cluster can't be deleted because there are instances present in the cluster. Be sure to delete all instances associated with the cluster before you delete the cluster.2.    Delete an instance in the clusterRun the following command:aws rds delete-db-instance --db-instance-identifier sample-instanceYou might receive one of the following error messages when trying to delete an instance in the cluster."InvalidParameterCombination: An error occurred (InvalidParameterCombination) when calling the DeleteDBInstance operation: FinalDBSnapshotIdentifier cannot be specified when deleting a cluster instance"You receive this error when you use the --final-db-snapshot-identifier option when you run the command to delete the instance in the cluster. This error warns you that you can't take a final snapshot when deleting an instance in the cluster. Either remove the --final-db-snapshot-identifier option or use the --skip-final-snapshot option, and then run the command again."InvalidDBClusterStateFault: 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”This error indicates that the Aurora cluster that you are trying to delete is acting as a replica, but the last instance of the cluster can't be deleted until the cluster is promoted to standalone.3.    Promote a replica clusterPromote a replica cluster by running this command:aws rds promote-read-replica-db-cluster --db-cluster-identifier rds-mysql-aurora-replica-cluster

Related informationHow do I delete or terminate RDS resources?Managing an Amazon Aurora DB clusterDeleting a DB instance in an Aurora DB cluster