Deleting an Amazon DocumentDB subnet group
You can use the AWS Management Console or AWS CLI to delete an Amazon DocumentDB subnet group. However, you cannot delete the default subnet group.
- Using the AWS Management Console
-
You can use the AWS Management Console to delete a subnet group. But you can't delete the
defaultsubnet group.To delete a subnet group
Sign in to the AWS Management Console, and open the Amazon DocumentDB console at https://console.aws.amazon.com/docdb
. -
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
defaultsubnet 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. -
Choose Actions, and then choose Delete.
-
In the confirmation dialog box:
-
To delete the subnet group, choose Delete.
-
To keep the subnet group, choose Cancel.
-
- Using the AWS CLI
-
To delete an Amazon DocumentDB subnet group using the AWS CLI, use the
delete-db-subnet-groupoperation 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 thedefaultsubnet group.
The following code deletes
sample-subnet-group.For Linux, macOS, or Unix:
aws docdb delete-db-subnet-group \ --db-subnet-group-namesample-subnet-groupFor Windows:
aws docdb delete-db-subnet-group ^ --db-subnet-group-namesample-subnet-groupThis operation produces no output.
-