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.

Deleting an Amazon DocumentDB Instance

You can delete your Amazon DocumentDB instance using either the AWS Management Console or the AWS CLI.

Amazon DocumentDB stores all of your data in the cluster volume. The data persists in that cluster volume, even if you remove all the instances from your cluster. (If you need to access the data again, you can add an instance to the cluster at any time, and pick up where you left off.)

Important

To delete an instance, the instance must be in the available state. You cannot delete an instance that is stopped. If the cluster is stopped, first start the cluster, wait for the instance to become available, and then delete the instance. For more information, see Stopping and Starting an Amazon DocumentDB Cluster.

You can delete an Amazon DocumentDB instance using the AWS Management Console or the AWS CLI.

Using the AWS Management Console

The following procedure deletes the instance of your choice using the console.

To delete an instance using the console

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

  2. In the navigation pane, choose Instances.

    Tip

    If you do not see the navigation pane on the left side of your screen, choose the menu icon () in the upper-left corner of the page.

  3. Choose the button to the left of the name of the instance that you want to delete.

  4. Choose Actions, and then choose Delete.

It takes several minutes for the instance to be deleted. To monitor the status of the instance, see Monitoring an Amazon DocumentDB Instance's Status.

Using the AWS CLI

Use the following AWS CLI code to delete the cluster sample-cluster-instance.

Required parameters

  • --db-instance-identifier—Required. The identifier of the instance that you want to delete.

For Linux, macOS, or Unix:

aws docdb delete-db-instance \ --db-instance-identifier sample-cluster-instance-00

For Windows:

aws docdb delete-db-instance ^ --db-instance-identifier sample-cluster-instance-00

Output from this operation looks something like the following (JSON format).

{ "DBInstance": { "DBClusterIdentifier": "sample-cluster", "StorageEncrypted": true, "DBInstanceStatus": "deleting", "DBInstanceArn": "arn:aws:rds:us-east-1:012345678901:db:sample-cluster-instance-00", "PendingModifiedValues": {}, "DBSubnetGroup": { "DBSubnetGroupDescription": "default", "VpcId": "vpc-91280df6", "SubnetGroupStatus": "Complete", "Subnets": [ { "SubnetAvailabilityZone": { "Name": "us-east-1a" }, "SubnetIdentifier": "subnet-4e26d263", "SubnetStatus": "Active" }, { "SubnetAvailabilityZone": { "Name": "us-east-1c" }, "SubnetIdentifier": "subnet-afc329f4", "SubnetStatus": "Active" }, { "SubnetAvailabilityZone": { "Name": "us-east-1e" }, "SubnetIdentifier": "subnet-b3806e8f", "SubnetStatus": "Active" }, { "SubnetAvailabilityZone": { "Name": "us-east-1d" }, "SubnetIdentifier": "subnet-53ab3636", "SubnetStatus": "Active" }, { "SubnetAvailabilityZone": { "Name": "us-east-1b" }, "SubnetIdentifier": "subnet-991cb8d0", "SubnetStatus": "Active" }, { "SubnetAvailabilityZone": { "Name": "us-east-1f" }, "SubnetIdentifier": "subnet-29ab1025", "SubnetStatus": "Active" } ], "DBSubnetGroupName": "default" }, "AutoMinorVersionUpgrade": true, "DBInstanceIdentifier": "sample-cluster-instance-00", "AvailabilityZone": "us-east-1a", "DBInstanceClass": "db.r5.large", "BackupRetentionPeriod": 1, "EngineVersion": "3.6.0", "PreferredMaintenanceWindow": "fri:09:32-fri:10:02", "Engine": "docdb", "PubliclyAccessible": false, "DbiResourceId": "db-BJKKB54PIDV5QFKGVRX5T3S6GM", "InstanceCreateTime": "2018-11-05T23:10:49.905Z", "PreferredBackupWindow": "00:00-00:30", "KmsKeyId": "arn:aws:kms:us-east-1:012345678901:key/0961325d-a50b-44d4-b6a0-a177d5ff730b", "PromotionTier": 2, "Endpoint": { "Address": "sample-cluster-instance-00.corcjozrlsfc.us-east-1.docdb.amazonaws.com", "HostedZoneId": "Z2R2ITUGPM61AM", "Port": 27017 }, "VpcSecurityGroups": [ { "Status": "active", "VpcSecurityGroupId": "sg-77186e0d" } ] } }

It takes several minutes for the instance to be deleted. To monitor the status of the instance, see Monitoring an Amazon DocumentDB Instance's Status.