DeleteCacheSubnetGroupCommand

Deletes a cache subnet group.

You cannot delete a default cache 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 { ElastiCacheClient, DeleteCacheSubnetGroupCommand } from "@aws-sdk/client-elasticache"; // ES Modules import
// const { ElastiCacheClient, DeleteCacheSubnetGroupCommand } = require("@aws-sdk/client-elasticache"); // CommonJS import
const client = new ElastiCacheClient(config);
const input = { // DeleteCacheSubnetGroupMessage
  CacheSubnetGroupName: "STRING_VALUE", // required
};
const command = new DeleteCacheSubnetGroupCommand(input);
const response = await client.send(command);
// {};

Example Usage

 Loading code editorLoading code editor

DeleteCacheSubnetGroupCommand Input

Parameter
Type
Description
CacheSubnetGroupName
Required
string | undefined

The name of the cache subnet group to delete.

Constraints: Must contain no more than 255 alphanumeric characters or hyphens.

DeleteCacheSubnetGroupCommand Output

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

Throws

Name
Fault
Details
CacheSubnetGroupInUse
client

The requested cache subnet group is currently in use.

CacheSubnetGroupNotFoundFault
client

The requested cache subnet group name does not refer to an existing cache subnet group.

ElastiCacheServiceException
Base exception class for all service exceptions from ElastiCache service.