- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
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
DescribeCacheSubnetGroupsCommand Input
Parameter | Type | Description |
---|
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 | number | undefined | The maximum number of records to include in the response. If more records exist than the specified Default: 100 Constraints: minimum 20; maximum 100. |
DescribeCacheSubnetGroupsCommand Output
Parameter | Type | Description |
---|
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 |
---|
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. |