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...

CreateDBInstance

Description

Creates a new DB instance.

Request Parameters

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

Name Description Required
AllocatedStorage

The amount of storage (in gigabytes) to be initially allocated for the database instance.

MySQL

Constraints: Must be an integer from 5 to 1024.

Type: Integer

Oracle

Constraints: Must be an integer from 10 to 1024.

SQL Server

Constraints: Must be an integer from 200 to 1024 (Standard Edition and Enterprise Edition) or from 30 to 1024 (Express Edition and Web Edition)

Type: Integer

Yes
AutoMinorVersionUpgrade

Indicates that minor engine upgrades will be applied automatically to the DB Instance during the maintenance window.

Default: true

Type: Boolean

No
AvailabilityZone

The EC2 Availability Zone that the database instance will be created in.

Default: A random, system-chosen Availability Zone in the endpoint's region.

Example: us-east-1d

Constraint: The AvailabilityZone parameter cannot be specified if the MultiAZ parameter is set to true. The specified Availability Zone must be in the same region as the current endpoint.

Type: String

No
BackupRetentionPeriod

The number of days for which automated backups are retained. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups.

Default: 1

Constraints:

  • Must be a value from 0 to 8
  • Cannot be set to 0 if the DB Instance is a master instance with read replicas

Type: Integer

No
CharacterSetName

For supported engines, indicates that the DB Instance should be associated with the specified CharacterSet.

Type: String

No
DBInstanceClass

The compute and memory capacity of the DB Instance. To determine the instance classes that are available for a particular DB engine, use the DescribeOrderableDBInstanceOptions action.

Valid Values: db.t1.micro | db.m1.small | db.m1.large | db.m1.xlarge | db.m2.xlarge |db.m2.2xlarge | db.m2.4xlarge

Type: String

Yes
DBInstanceIdentifier

The DB Instance identifier. This parameter is stored as a lowercase string.

Constraints:

  • Must contain from 1 to 63 alphanumeric characters or hyphens (1 to 15 for SQL Server).
  • First character must be a letter.
  • Cannot end with a hyphen or contain two consecutive hyphens.

Example: mydbinstance

Type: String

Yes
DBName

The meaning of this parameter differs according to the database engine you use.

MySQL

The name of the database to create when the DB Instance is created. If this parameter is not specified, no database is created in the DB Instance.

Constraints:

  • Must contain 1 to 64 alphanumeric characters
  • Cannot be a word reserved by the specified database engine

Type: String

Oracle

The Oracle System ID (SID) of the created DB Instance.

Default: ORACL

Constraints:

  • Cannot be longer than 8 characters

Type: String

SQL Server

Not applicable. Must be null.

Type: String

No
DBParameterGroupName

The name of the DB Parameter Group to associate with this DB instance. If this argument is omitted, the default DBParameterGroup for the specified engine will be used.

Constraints:

  • Must be 1 to 255 alphanumeric characters
  • First character must be a letter
  • Cannot end with a hyphen or contain two consecutive hyphens

Type: String

No
DBSecurityGroups.member.N

A list of DB Security Groups to associate with this DB Instance.

Default: The default DB Security Group for the database engine.

Type: String list

No
DBSubnetGroupName

A DB Subnet Group to associate with this DB Instance.

If there is no DB Subnet Group, then it is a non-VPC DB instance.

Type: String

No
Engine

The name of the database engine to be used for this instance.

Valid Values: MySQL | oracle-se1 | oracle-se | oracle-ee | sqlserver-ee | sqlserver-se | sqlserver-ex | sqlserver-web

Type: String

Yes
EngineVersion

The version number of the database engine to use.

MySQL

Example: 5.1.42

Type: String

Oracle

Example: 11.2.0.2.v2

Type: String

SQL Server

Example: 10.50.2789.0.v1

Type: String

No
LicenseModel

License model information for this DB Instance.

Valid values: license-included | bring-your-own-license | general-public-license

Type: String

No
MasterUserPassword

The password for the master database user.

MySQL

Constraints: Must contain from 8 to 41 alphanumeric characters.

Type: String

Oracle

Constraints: Must contain from 8 to 30 alphanumeric characters.

SQL Server

Constraints: Must contain from 8 to 128 alphanumeric characters.

Type: String

Yes
MasterUsername

The name of master user for the client DB Instance.

MySQL

Constraints:

  • Must be 1 to 16 alphanumeric characters.
  • First character must be a letter.
  • Cannot be a reserved word for the chosen database engine.

Type: String

Oracle

Constraints:

  • Must be 1 to 30 alphanumeric characters.
  • First character must be a letter.
  • Cannot be a reserved word for the chosen database engine.

SQL Server

Constraints:

  • Must be 1 to 128 alphanumeric characters.
  • First character must be a letter.
  • Cannot be a reserved word for the chosen database engine.

Type: String

Yes
MultiAZ

Specifies if the DB Instance is a Multi-AZ deployment. For Microsoft SQL Server, must be set to false. You cannot set the AvailabilityZone parameter if the MultiAZ parameter is set to true.

Type: Boolean

No
OptionGroupName

Indicates that the DB Instance should be associated with the specified option group.

Type: String

No
Port

The port number on which the database accepts connections.

MySQL

Default: 3306

Valid Values: 1150-65535

Type: Integer

Oracle

Default: 1521

Valid Values: 1150-65535

SQL Server

Default: 1433

Valid Values: 1150-65535 except for 1434 and 3389.

Type: Integer

No
PreferredBackupWindow

The daily time range during which automated backups are created if automated backups are enabled, using the BackupRetentionPeriod parameter.

Default: A 30-minute window selected at random from an 8-hour block of time per region. The following list shows the time blocks for each region from which the default backup windows are assigned.

  • US-East (Northern Virginia) Region: 03:00-11:00 UTC
  • US-West (Northern California) Region: 06:00-14:00 UTC
  • EU (Ireland) Region: 22:00-06:00 UTC
  • Asia Pacific (Singapore) Region: 14:00-22:00 UTC
  • Asia Pacific (Tokyo) Region: 17:00-03:00 UTC

Constraints: Must be in the format hh24:mi-hh24:mi. Times should be Universal Time Coordinated (UTC). Must not conflict with the preferred maintenance window. Must be at least 30 minutes.

Type: String

No
PreferredMaintenanceWindow

The weekly time range (in UTC) during which system maintenance can occur.

Format: ddd:hh24:mi-ddd:hh24:mi

Default: A 30-minute window selected at random from an 8-hour block of time per region, occurring on a random day of the week. The following list shows the time blocks for each region from which the default maintenance windows are assigned.

  • US-East (Northern Virginia) Region: 03:00-11:00 UTC
  • US-West (Northern California) Region: 06:00-14:00 UTC
  • EU (Ireland) Region: 22:00-06:00 UTC
  • Asia Pacific (Singapore) Region: 14:00-22:00 UTC
  • Asia Pacific (Tokyo) Region: 17:00-03:00 UTC

Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun

Constraints: Minimum 30-minute window.

Type: String

No

Response Elements

The following elements come wrapped in a DBInstance structure.
NameDescription
AllocatedStorage

Specifies the allocated storage size specified in gigabytes.

Type: Integer

AutoMinorVersionUpgrade

Indicates that minor version patches are applied automatically.

Type: Boolean

AvailabilityZone

Specifies the name of the Availability Zone the DB Instance is located in.

Type: String

BackupRetentionPeriod

Specifies the number of days for which automatic DB Snapshots are retained.

Type: Integer

CharacterSetName

If present, specifies the name of the character set that this instance is associated with.

Type: String

DBInstanceClass

Contains the name of the compute and memory capacity class of the DB Instance.

Type: String

DBInstanceIdentifier

Contains a user-supplied database identifier. This is the unique key that identifies a DB Instance.

Type: String

DBInstanceStatus

Specifies the current state of this database.

Type: String

DBName

The meaning of this parameter differs according to the database engine you use.

MySQL

Contains the name of the initial database of this instance that was provided at create time, if one was specified when the DB Instance was created. This same name is returned for the life of the DB Instance.

Type: String

Oracle

Contains the Oracle System ID (SID) of the created DB Instance.

Type: String

DBParameterGroups

Provides the list of DB Parameter Groups applied to this DB Instance.

Type: DBParameterGroupStatus list

DBSecurityGroups

Provides List of DB Security Group elements containing only DBSecurityGroup.Name and DBSecurityGroup.Status subelements.

Type: DBSecurityGroupMembership list

DBSubnetGroup

Provides the inforamtion of the subnet group associated with the DB instance, including the name, descrption and subnets in the subnet group.

Type: DBSubnetGroup

Endpoint

Specifies the connection endpoint.

Type: Endpoint

Engine

Provides the name of the database engine to be used for this DB Instance.

Type: String

EngineVersion

Indicates the database engine version.

Type: String

InstanceCreateTime

Provides the date and time the DB Instance was created.

Type: DateTime

LatestRestorableTime

Specifies the latest time to which a database can be restored with point-in-time restore.

Type: DateTime

LicenseModel

License model information for this DB Instance.

Type: String

MasterUsername

Contains the master username for the DB Instance.

Type: String

MultiAZ

Specifies if the DB Instance is a Multi-AZ deployment.

Type: Boolean

OptionGroupMembership

Specifies the name and status of the option group that this instance belongs to.

Type: OptionGroupMembership

PendingModifiedValues

Specifies that changes to the DB Instance are pending. This element is only included when changes are pending. Specific changes are identified by subelements.

Type: PendingModifiedValues

PreferredBackupWindow

Specifies the daily time range during which automated backups are created if automated backups are enabled, as determined by the BackupRetentionPeriod.

Type: String

PreferredMaintenanceWindow

Specifies the weekly time range (in UTC) during which system maintenance can occur.

Type: String

ReadReplicaDBInstanceIdentifiers

Contains one or more identifiers of the Read Replicas associated with this DB Instance.

Type: String list

ReadReplicaSourceDBInstanceIdentifier

Contains the identifier of the source DB Instance if this DB Instance is a Read Replica.

Type: String

Errors

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

Error Description HTTP Status Code
DBInstanceAlreadyExists

User already has a DB Instance with the given identifier.

400
DBParameterGroupNotFound

DBParameterGroupName does not refer to an existing DB Parameter Group.

404
DBSecurityGroupNotFound

DBSecurityGroupName does not refer to an existing DB Security Group.

404
DBSubnetGroupNotFound

DBSubnetGroupName does not refer to an existing DB Subnet Group.

400
InstanceQuotaExceeded

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

400
InsufficientDBInstanceCapacity

Specified DB Instance class is not available in the specified Availability Zone.

400
InvalidVPCNetworkState

DB Subnet Group does not cover all availability zones after it is created because users' change.

400
StorageQuotaExceeded

Request would result in user exceeding the allowed amount of storage available across all DB Instances.

400

Examples

Sample Request

https://rds.amazonaws.com/
   ?Action=CreateDBInstance
   &DBInstanceIdentifier=SimCoProd01
   &Engine=mysql
   &MasterUserPassword=Password01
   &AllocatedStorage=10
   &MasterUsername=master
   &Version=2012-04-23
   &DBInstanceClass=db.m1.large
   &DBSubnetGroupName=dbSubnetgroup01
   &SignatureVersion=2
   &SignatureMethod=HmacSHA256
   &Timestamp=2011-05-23T05%3A54%3A53.578Z
   &AWSAccessKeyId=<AWS Access Key ID>
   &Signature=<Signature>

Sample Response

<CreateDBInstanceResponse xmlns="http://rds.amazonaws.com/doc/2012-04-23/">
    <CreateDBInstanceResult>
        <DBInstance>
            <ReadReplicaDBInstanceIdentifiers/>
            <Engine>mysql</Engine>
            <PendingModifiedValues>
                <MasterUserPassword>****</MasterUserPassword>
            </PendingModifiedValues>
            <BackupRetentionPeriod>1</BackupRetentionPeriod>
            <MultiAZ>false</MultiAZ>
            <LicenseModel>general-public-license</LicenseModel>
            <DBSubnetGroup>
                <VpcId>990524496922</VpcId>
                <SubnetGroupStatus>Complete</SubnetGroupStatus>
                <DBSubnetGroupDescription>description</DBSubnetGroupDescription>
                <DBSubnetGroupName>subnet_grp1</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>            
            <DBInstanceStatus>creating</DBInstanceStatus>
            <EngineVersion>5.1.50</EngineVersion>
            <DBInstanceIdentifier>simcoprod01</DBInstanceIdentifier>
            <DBParameterGroups>
                <DBParameterGroup>
                    <ParameterApplyStatus>in-sync</ParameterApplyStatus>
                    <DBParameterGroupName>default.mysql5.1</DBParameterGroupName>
                </DBParameterGroup>
            </DBParameterGroups>
            <DBSecurityGroups>
                <DBSecurityGroup>
                    <Status>active</Status>
                    <DBSecurityGroupName>default</DBSecurityGroupName>
                </DBSecurityGroup>
            </DBSecurityGroups>
            <PreferredBackupWindow>00:00-00:30</PreferredBackupWindow>
            <AutoMinorVersionUpgrade>true</AutoMinorVersionUpgrade>
            <PreferredMaintenanceWindow>sat:07:30-sat:08:00</PreferredMaintenanceWindow>
                <AllocatedStorage>10</AllocatedStorage>
                <DBInstanceClass>db.m1.large</DBInstanceClass>
                <MasterUsername>master</MasterUsername>
        </DBInstance>
    </CreateDBInstanceResult>
    <ResponseMetadata>
        <RequestId>2e5d4270-8501-11e0-bd9b-a7b1ece36d51</RequestId>
    </ResponseMetadata>
</CreateDBInstanceResponse>