Deleting an Amazon DocumentDB subnet group - Amazon DocumentDB
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Deleting an Amazon DocumentDB subnet group

You can use the Amazon Web Services Management Console or Amazon CLI to delete an Amazon DocumentDB subnet group. However, you cannot delete the default subnet group.

Using the Amazon Web Services Management Console

You can use the Amazon Web Services Management Console to delete a subnet group. But you can't delete the default subnet group.

To delete a subnet group
  1. Sign in to the Amazon Web Services Management Console, and open the Amazon DocumentDB console at https://console.amazonaws.cn/docdb.

  2. In the navigation pane, choose Subnet groups. Then choose the button to the left of the subnet group's name. Remember that you can't delete the default subnet group.

    Tip

    If you don't 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 Actions, and then choose Delete.

  4. In the confirmation dialog box:

    • To delete the subnet group, choose Delete.

    • To keep the subnet group, choose Cancel.

Using the Amazon CLI

To delete an Amazon DocumentDB subnet group using the Amazon CLI, use the delete-db-subnet-group operation with the following parameter.

Parameter
  • --db-subnet-group-name—Required. The name of the Amazon DocumentDB subnet group to delete. Remember that you can't delete the default subnet group.

The following code deletes sample-subnet-group.

For Linux, macOS, or Unix:

aws docdb delete-db-subnet-group \ --db-subnet-group-name sample-subnet-group

For Windows:

aws docdb delete-db-subnet-group ^ --db-subnet-group-name sample-subnet-group

This operation produces no output.