DeleteDBSubnetGroupCommand

Deletes a subnet group.

The specified database subnet group must not be associated with any DB instances.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { DocDBClient, DeleteDBSubnetGroupCommand } from "@aws-sdk/client-docdb"; // ES Modules import
// const { DocDBClient, DeleteDBSubnetGroupCommand } = require("@aws-sdk/client-docdb"); // CommonJS import
const client = new DocDBClient(config);
const input = { // DeleteDBSubnetGroupMessage
  DBSubnetGroupName: "STRING_VALUE", // required
};
const command = new DeleteDBSubnetGroupCommand(input);
const response = await client.send(command);
// {};

DeleteDBSubnetGroupCommand Input

See DeleteDBSubnetGroupCommandInput for more details

Parameter
Type
Description
DBSubnetGroupName
Required
string | undefined

The name of the database subnet group to delete.

You can't delete the default subnet group.

Constraints:

Must match the name of an existing DBSubnetGroup. Must not be default.

Example: mySubnetgroup

DeleteDBSubnetGroupCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.

Throws

Name
Fault
Details
DBSubnetGroupNotFoundFault
client

DBSubnetGroupName doesn't refer to an existing subnet group.

InvalidDBSubnetGroupStateFault
client

The subnet group can't be deleted because it's in use.

InvalidDBSubnetStateFault
client

The subnet isn't in the available state.

DocDBServiceException
Base exception class for all service exceptions from DocDB service.