Menu
Amazon ElastiCache
API Reference (API Version 2015-02-02)

CreateCacheSubnetGroup

Creates a new cache subnet group.

Use this parameter only when you are creating a cluster in an Amazon Virtual Private Cloud (Amazon VPC).

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

CacheSubnetGroupDescription

A description for the cache subnet group.

Type: String

Required: Yes

CacheSubnetGroupName

A name for the cache subnet group. This value is stored as a lowercase string.

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

Example: mysubnetgroup

Type: String

Required: Yes

SubnetIds.SubnetIdentifier.N

A list of VPC subnet IDs for the cache subnet group.

Type: Array of strings

Required: Yes

Response Elements

The following element is returned by the service.

CacheSubnetGroup

Represents the output of one of the following operations:

  • CreateCacheSubnetGroup

  • ModifyCacheSubnetGroup

Type: CacheSubnetGroup object

Errors

For information about the errors that are common to all actions, see Common Errors.

CacheSubnetGroupAlreadyExists

The requested cache subnet group name is already in use by an existing cache subnet group.

HTTP Status Code: 400

CacheSubnetGroupQuotaExceeded

The request cannot be processed because it would exceed the allowed number of cache subnet groups.

HTTP Status Code: 400

CacheSubnetQuotaExceededFault

The request cannot be processed because it would exceed the allowed number of subnets in a cache subnet group.

HTTP Status Code: 400

InvalidSubnet

An invalid subnet identifier was specified.

HTTP Status Code: 400

Example

CreateCacheSubnetGroup

Sample Request

https://elasticache.amazonaws.com/ ?Action=CreateCacheSubnetGroup &CacheSubnetGroupName=myCachesubnetgroup &CacheSubnetGroupDescription=My%20new%20CacheSubnetGroup &Version=2015-02-02 &SignatureVersion=4 &SignatureMethod=HmacSHA256 &Timestamp=20150202T192317Z &X-Amz-Credential=<credential>

Sample Response

<CreateCacheSubnetGroupResponse xmlns="http://elasticache.amazonaws.com/doc/2015-02-02/"> <CreateCacheSubnetGroupResult> <CacheSubnetGroup> <VpcId>990524496922</VpcId> <CacheSubnetGroupDescription>My new CacheSubnetGroup</CacheSubnetGroupDescription> <CacheSubnetGroupName>myCachesubnetgroup</CacheSubnetGroupName> <Subnets> <Subnet> <SubnetStatus>Active</SubnetStatus> <SubnetIdentifier>subnet-7c5b4115</SubnetIdentifier> <SubnetAvailabilityZone> <Name>us-west-2c</Name> </SubnetAvailabilityZone> </Subnet> <Subnet> <SubnetStatus>Active</SubnetStatus> <SubnetIdentifier>subnet-7b5b4112</SubnetIdentifier> <SubnetAvailabilityZone> <Name>us-west-2b</Name> </SubnetAvailabilityZone> </Subnet> <Subnet> <SubnetStatus>Active</SubnetStatus> <SubnetIdentifier>subnet-3ea6bd57</SubnetIdentifier> <SubnetAvailabilityZone> <Name>us-west-2c</Name> </SubnetAvailabilityZone> </Subnet> </Subnets> </CacheSubnetGroup> </CreateCacheSubnetGroupResult> <ResponseMetadata> <RequestId>ed662948-a57b-11df-9e38-7ffab86c801f</RequestId> </ResponseMetadata> </CreateCacheSubnetGroupResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: