Amazon DocumentDB
Developer Guide

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

Step 4: (Optional) Delete the Amazon DocumentDB Instance and Cluster

If you are no longer using your Amazon DocumentDB cluster, you should either stop or delete it so that you aren't charged for resources that you're not using. When you delete the cluster you lose all its data unless you created a manual backup. When you stop a cluster you save the costs of instance-hours and retain your data. For information on stopping a cluster, see Stopping and Starting an Amazon DocumentDB Cluster.

Deleting a cluster cannot be reversed, though you can restore the cluster from a manual or final backup if you make one.

Amazon DocumentDB enforces deletion protection for a cluster whether you perform the delete operation using the console or the AWS CLI. If deletion protection enabled, you can't delete a cluster. To delete a cluster that has deletion projection enabled, you must first modify the cluster and disable deletion protection.

When using the console with deletion protection enabled on a cluster, you can't delete the cluster's last instance because doing so also deletes the cluster.

To determine whether a cluster has deletion protection enabled

  1. Sign in to the AWS Management Console, and open the Amazon DocumentDB console at https://console.aws.amazon.com/docdb.

  2. Choose the cluster's name, and scroll to the bottom of the Cluster details section. Locate Deletion protection. If deletion protection is enabled, modify the cluster to disable deletion protection. For information about modifying a cluster, see Modifying an Amazon DocumentDB Cluster.

    
                        Screenshot showing Amazon DocumentDB Cluster details, with Deletion protection
                           enabled.

    After Deletion protection is disabled, you are ready to delete the cluster.

To delete a cluster

  1. In the navigation pane, choose Clusters. Find the cluster that you want to delete, and choose the button to the left of the cluster name.

  2. Determine whether the cluster has any instances by checking the Instances column.

    
                        Screenshot showing list of cluster identifiers with instances column
                           highlighted.
  3. Depending on whether your cluster has any instances, do one of the following steps.

    • If the cluster has no instances, choose Actions, and then choose Delete. Complete the Delete <cluster-name> dialog box, and then choose Delete.

    • If the cluster has one or more instances, do the following:

      1. In the navigation pane, choose Instances.

      2. Delete each of the cluster's instances. When you delete the last instance, the cluster is also deleted. For information about deleting instances, see Deleting an Amazon DocumentDB Instance.

It takes several minutes for a cluster to be deleted. To monitor the status of the cluster, see Monitoring a Cluster's Status in Amazon DocumentDB.