DescribeCacheSubnetGroupsCommand

Returns a list of cache subnet group descriptions. If a subnet group name is specified, the list contains only the description of that group. This is applicable only when you have ElastiCache in VPC setup. All ElastiCache clusters now launch in VPC by default.

Example Syntax

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

import { ElastiCacheClient, DescribeCacheSubnetGroupsCommand } from "@aws-sdk/client-elasticache"; // ES Modules import
// const { ElastiCacheClient, DescribeCacheSubnetGroupsCommand } = require("@aws-sdk/client-elasticache"); // CommonJS import
const client = new ElastiCacheClient(config);
const input = { // DescribeCacheSubnetGroupsMessage
  CacheSubnetGroupName: "STRING_VALUE",
  MaxRecords: Number("int"),
  Marker: "STRING_VALUE",
};
const command = new DescribeCacheSubnetGroupsCommand(input);
const response = await client.send(command);
// { // CacheSubnetGroupMessage
//   Marker: "STRING_VALUE",
//   CacheSubnetGroups: [ // CacheSubnetGroups
//     { // CacheSubnetGroup
//       CacheSubnetGroupName: "STRING_VALUE",
//       CacheSubnetGroupDescription: "STRING_VALUE",
//       VpcId: "STRING_VALUE",
//       Subnets: [ // SubnetList
//         { // Subnet
//           SubnetIdentifier: "STRING_VALUE",
//           SubnetAvailabilityZone: { // AvailabilityZone
//             Name: "STRING_VALUE",
//           },
//           SubnetOutpost: { // SubnetOutpost
//             SubnetOutpostArn: "STRING_VALUE",
//           },
//           SupportedNetworkTypes: [ // NetworkTypeList
//             "ipv4" || "ipv6" || "dual_stack",
//           ],
//         },
//       ],
//       ARN: "STRING_VALUE",
//       SupportedNetworkTypes: [
//         "ipv4" || "ipv6" || "dual_stack",
//       ],
//     },
//   ],
// };

Example Usage

// Describes up to 25 cache subnet groups.
const input = {
MaxRecords: 25
};
const command = new DescribeCacheSubnetGroupsCommand(input);
const response = await client.send(command);
/* response is
{
CacheSubnetGroups: [
{
CacheSubnetGroupDescription: "Default CacheSubnetGroup",
CacheSubnetGroupName: "default",
Subnets: [
{
SubnetAvailabilityZone: {
Name: "us-east-1a"
},
SubnetIdentifier: "subnet-1a2b3c4d"
},
{
SubnetAvailabilityZone: {
Name: "us-east-1c"
},
SubnetIdentifier: "subnet-a1b2c3d4"
},
{
SubnetAvailabilityZone: {
Name: "us-east-1e"
},
SubnetIdentifier: "subnet-abcd1234"
},
{
SubnetAvailabilityZone: {
Name: "us-east-1b"
},
SubnetIdentifier: "subnet-1234abcd"
}
],
VpcId: "vpc-91280df6"
}
],
Marker: ""
}
*\/
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
JavaScriptLn 1, Col 1
Errors: 0 Warnings: 0

DescribeCacheSubnetGroupsCommand Input

Parameter
Type
Description
CacheSubnetGroupName
string | undefined

The name of the cache subnet group to return details for.

Marker
string | undefined

An optional marker returned from a prior request. Use this marker for pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords.

MaxRecords
number | undefined

The maximum number of records to include in the response. If more records exist than the specified MaxRecords value, a marker is included in the response so that the remaining results can be retrieved.

Default: 100

Constraints: minimum 20; maximum 100.

DescribeCacheSubnetGroupsCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
CacheSubnetGroups
CacheSubnetGroup[] | undefined

A list of cache subnet groups. Each element in the list contains detailed information about one group.

Marker
string | undefined

Provides an identifier to allow retrieval of paginated results.

Throws

Name
Fault
Details
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.