CreateSubnetGroup - Amazon MemoryDB
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

CreateSubnetGroup

Creates a subnet group. A subnet group is a collection of subnets (typically private) that you can designate for your clusters running in an Amazon Virtual Private Cloud (VPC) environment. When you create a cluster in an Amazon VPC, you must specify a subnet group. MemoryDB uses that subnet group to choose a subnet and IP addresses within that subnet to associate with your nodes. For more information, see Subnets and subnet groups.

Request Syntax

{ "Description": "string", "SubnetGroupName": "string", "SubnetIds": [ "string" ], "Tags": [ { "Key": "string", "Value": "string" } ] }

Request Parameters

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

The request accepts the following data in JSON format.

Description

A description for the subnet group.

Type: String

Required: No

SubnetGroupName

The name of the subnet group.

Type: String

Required: Yes

SubnetIds

A list of VPC subnet IDs for the subnet group.

Type: Array of strings

Required: Yes

Tags

A list of tags to be added to this resource. A tag is a key-value pair. A tag key must be accompanied by a tag value, although null is accepted.

Type: Array of Tag objects

Array Members: Maximum number of 200 items.

Required: No

Response Syntax

{ "SubnetGroup": { "ARN": "string", "Description": "string", "Name": "string", "Subnets": [ { "AvailabilityZone": { "Name": "string" }, "Identifier": "string" } ], "VpcId": "string" } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

SubnetGroup

The newly-created subnet group

Type: SubnetGroup object

Errors

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

InvalidSubnet

HTTP Status Code: 400

ServiceLinkedRoleNotFoundFault

HTTP Status Code: 400

SubnetGroupAlreadyExistsFault

HTTP Status Code: 400

SubnetGroupQuotaExceededFault

HTTP Status Code: 400

SubnetNotAllowedFault

HTTP Status Code: 400

SubnetQuotaExceededFault

HTTP Status Code: 400

TagQuotaPerResourceExceeded

HTTP Status Code: 400

See Also

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