DeleteSubnetGroupCommand

Deletes a subnet group. You cannot delete a default subnet group or one that is associated with any clusters.

Example Syntax

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

import { MemoryDBClient, DeleteSubnetGroupCommand } from "@aws-sdk/client-memorydb"; // ES Modules import
// const { MemoryDBClient, DeleteSubnetGroupCommand } = require("@aws-sdk/client-memorydb"); // CommonJS import
const client = new MemoryDBClient(config);
const input = { // DeleteSubnetGroupRequest
  SubnetGroupName: "STRING_VALUE", // required
};
const command = new DeleteSubnetGroupCommand(input);
const response = await client.send(command);
// { // DeleteSubnetGroupResponse
//   SubnetGroup: { // SubnetGroup
//     Name: "STRING_VALUE",
//     Description: "STRING_VALUE",
//     VpcId: "STRING_VALUE",
//     Subnets: [ // SubnetList
//       { // Subnet
//         Identifier: "STRING_VALUE",
//         AvailabilityZone: { // AvailabilityZone
//           Name: "STRING_VALUE",
//         },
//       },
//     ],
//     ARN: "STRING_VALUE",
//   },
// };

DeleteSubnetGroupCommand Input

See DeleteSubnetGroupCommandInput for more details

Parameter
Type
Description
SubnetGroupName
Required
string | undefined

The name of the subnet group to delete.

DeleteSubnetGroupCommand Output

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

The subnet group object that has been deleted.

Throws

Name
Fault
Details
ServiceLinkedRoleNotFoundFault
client

SubnetGroupInUseFault
client

SubnetGroupNotFoundFault
client

MemoryDBServiceException
Base exception class for all service exceptions from MemoryDB service.