Amazon Relational Database Service
API Reference (API Version 2012-04-23)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

CreateDBSubnetGroup

Description

Creates a new DB subnet group. DB subnet groups must contain at least one subnet in each AZ in the region.

Request Parameters

For information about the common parameters that all actions use, see Common Query Parameters.

Name Description Required
DBSubnetGroupDescription

The description for the DB Subnet Group.

Type: String

Yes
DBSubnetGroupName

The name for the DB Subnet Group. This value is stored as a lowercase string.

Constraints: Must contain no more than 255 alphanumeric characters or hyphens. Must not be "Default".

Example: mySubnetgroup

Type: String

Yes
SubnetIds.member.N

The EC2 Subnet IDs for the DB Subnet Group.

Type: String list

Yes

Response Elements

The following elements come wrapped in a DBSubnetGroup structure.
NameDescription
DBSubnetGroupDescription

Provides the description of the DB Subnet Group.

Type: String

DBSubnetGroupName

Specifies the name of the DB Subnet Group.

Type: String

SubnetGroupStatus

Provides the status of the DB Subnet Group.

Type: String

Subnets

Contains a list of ??? elements.

Type: Subnet list

VpcId

Provides the VpcId of the DB Subnet Group.

Type: String

Errors

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

Error Description HTTP Status Code
DBSubnetGroupAlreadyExists

DBSubnetGroupName is already used by an existing DBSubnetGroup.

400
DBSubnetGroupListDoesNotCoverAllAz

Subnets in the DB subnet group should cover all availability zones.

400
DBSubnetGroupQuotaExceeded

Request would result in user exceeding the allowed number of DB Subnet Groups.

400
DBSubnetQuotaExceeded

Request would result in user exceeding the allowed number of subnets in a DB subnet Groups.

400
InvalidSubnet

Request subnet is valid, or all subnets are not in common Vpc.

400

Examples

Sample Request

https://rds.amazonaws.com/
    ?Action=CreateDBSubnetGroup
    &DBSubnetGroupName=mydbsubnetgroup
    &DBSubnetGroupDescription=My%20new%20DBSubnetGroup
    &Version=2012-04-23
    &SignatureVersion=2
    &SignatureMethod=HmacSHA256
    &Timestamp=2011-02-15T18%3A14%3A49.482Z
    &AWSAccessKeyId=<AWS Access Key ID>
    &Signature=<Signature>

Sample Response

<CreateDBSubnetGroupResponse xmlns="http://rds.amazonaws.com/doc/2012-04-23/">
    <CreateDBSubnetGroupResult>
            <DBSubnetGroup>
                <VpcId>990524496922</VpcId>
                <SubnetGroupStatus>Complete</SubnetGroupStatus>
                <DBSubnetGroupDescription>My new DBSubnetGroup</DBSubnetGroupDescription>
                <DBSubnetGroupName>mydbsubnetgroup</DBSubnetGroupName>
                <Subnets>
                    <Subnet>
                        <SubnetStatus>Active</SubnetStatus>
                        <SubnetIdentifier>subnet-7c5b4115</SubnetIdentifier>
                        <SubnetAvailabilityZone>
                            <Name>us-east-1c</Name>
                        </SubnetAvailabilityZone>
                    </Subnet>
                    <Subnet>
                        <SubnetStatus>Active</SubnetStatus>
                        <SubnetIdentifier>subnet-7b5b4112</SubnetIdentifier>
                        <SubnetAvailabilityZone>
                            <Name>us-east-1b</Name>
                        </SubnetAvailabilityZone>
                    </Subnet>
                    <Subnet>
                        <SubnetStatus>Active</SubnetStatus>
                        <SubnetIdentifier>subnet-3ea6bd57</SubnetIdentifier>
                        <SubnetAvailabilityZone>
                            <Name>us-east-1d</Name>
                        </SubnetAvailabilityZone>
                    </Subnet>
                </Subnets>
            </DBSubnetGroup>       
        </CreateDBSubnetGroupResult>
        <ResponseMetadata>
            <RequestId>ed662948-a57b-11df-9e38-7ffab86c801f</RequestId>
        </ResponseMetadata>
    </CreateDBSubnetGroupResponse>