Amazon Relational Database Service
Command Line Interface 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...

rds-create-db-instance-read-replica

Description

Creates a DB Instance that acts as a Read Replica of a source DB Instance.

[Note]Note

Read Replicas are only supported with the MySQL database engine.

All Read Replica DB Instances are created as Single-AZ deployments with backups disabled. All other DB Instance attributes (including DB Security Groups and DB Parameter Groups) are inherited from the source DB Instance, except where specified otherwise.

Syntax

rds-create-db-instance-read-replica DBInstanceIdentifier

-s (--source-db-instance-identifier) value

[-c (--db-instance-class) value ]

[-au (--auto-minor-version-upgrade) value ]

[-z (--availability-zone) value ]

[-p (--port) value ]

[General Options]

Options

NameDescriptionRequired

DBInstanceIdentifier

--db-instance-identifier value

DB Instance identifier of the Read Replica. This is the unique key that identifies a DB Instance. This parameter is stored as a lowercase string. This can also be passed as a named parameter using --db-instance-identifier value

Type: String

Default: None

Constraints:

  • Must contain from 1 to 63 alphanumeric characters or hyphens.

  • First character must be a letter.

  • Cannot end with a hyphen or contain two consecutive hyphens.

Example: myinstance

Yes

-s value

--source-db-instance-identifier value

The identifier of the DB Instance for which this DB Instance will act as a Read Replica. You can have up to 5 read replicas per DB Instance.

Type: String

Constraints:

  • Must be the identifier of an existing DB Instance that is not already a Read Replica DB Instance.

  • The specified source DB Instance must have backups enabled.

Yes

-c value

--db-instance-class value

Contains the compute and memory capacity of the Read Replica.

Type: String

Default: Inherits from the source DB Instance. Different instance classes are available for different database engines. For information about valid values for a particular engine, use the rds-describe-orderable-db-instance-options command.

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

Example: --db-instance-class db.m1.xlarge

No

--port value

Port number that the Read Replica uses for connections.

Type: Integer

Default: Inherits from the source DB Instance

Example: --port 1234

No

-au value

--auto-minor-version-upgrade value

Indicates that minor engine upgrades will be applied automatically to the Read Replica during the maintenance window.

Type: Boolean

Default: Inherits from the source DB Instance

Example: -au true

No

-z value

--availability-zone value

The EC2 Availability Zone that the Read Replica will be created in.

Type: String

Default: A random, system-chosen Availability Zone in the same region as the current endpoint.

Constraints: The --availability-zone parameter cannot be set if the --multi-az parameter is set to true.

Example: --availability-zone us-east-1a

No

Output

The command returns a table that contains the following information:

  • DBInstanceID—The user-supplied DB Instance identifier

  • Created—The data and time the instance was created, in 24-hour UTC

  • Class—The compute and memory capacity of the instance

  • Engine—Name of the database engine to be used for this DB Instance

  • Storage—Initially allocated storage size specified in gigabytes (GBs)

  • Master Username—The master username for the DB Instance

  • Status—The current status of the DB Instance. Valid values: available | backing-up | creating | deleted | deleting | failed | modifying | rebooting | resetting-master-credentials | storage-full | incompatible-parameters | incompatible-restore

  • Endpoint Address—Address of the DB Instance

  • Port—Port used to connect to the DB Instance

  • AZ—The instance's Availability Zone

  • Backup Retention—The number of days that automated backups are retained before deletion

  • PendingBackupRetention—The backup retention period that will be applied at the next maintenance window, or that is currently being applied if the --apply-immediately option was specified

  • PendingClass—The class to which the instance will be scaled during the next maintenance window, or to which it is currently being scaled if the --apply-immediately option was specified

  • PendingCredentials—The (hidden) master user password that will be applied to the DB Instance

  • PendingStorage—The storage size to which the instance will be scaled during the next maintenance window, or to which it is currently being scaled if the --apply-immediately option was specified

  • PendingMulti-AZ—If true, indicates that the instance will be converted to run as a Multi-AZ deployment; if false, the instance will be converted to run as a standard (Single-AZ) deployment.

  • PendingVersion—The engine version of the pending database instance.

  • DB Name—Name of the initial database created when the instance was created. This column appears only in the --show-long view

  • Maintenance Window—The period during which patching and instance modifications will be performed. This column appears only in the --show-long view

  • Backup Window—The period during which automated backups are created. This column appears only in the --show-long view

  • Latest Restorable Time—The latest time to which a database can be restored using point-in-time restore. This column appears only in the --show-long view.

  • Multi-AZ—Indicates if this is a Multi-AZ DB Instance.

  • EngineVersion—The version number of the database engine.

  • Auto Minor Version Upgrade—Indicates that minor version upgrades will be applied to the DB Instance during the maintenance window. This column appears only in the --show-long view.

  • Name—The DB Security Group name

  • Status—Status of authorization. Valid values: authorizing | authorized | revoking

  • Group Name—Name of DB Parameter Group applied to

  • Apply Status—Status of applying the parameter group. It can be either in-sync or pending-reboot

  • Read Replica ID—The identifier of the source DB Instance for which this DB Instance acts as a Read Replica

Examples

Create a Read Replica with Minimal Parameters

This example creates a Read Replica with the minimal set of parameters.

PROMPT> rds-create-db-instance-read-replica SimCoProd01Replica01 -s SimcoProd01
                
DBINSTANCE  simcoprod01replica01  db.m1.large  mysql  10  master  creating  
   us-east-1b  0  n  5.1.50  simcoprod01
SECGROUP  default  active
PARAMGRP  default.mysql5.1  in-sync           

Create a Read Replica and Specify an Availability Zone

This example creates a Read Replica, specifying an availability zone.

PROMPT> rds-create-db-instance-read-replica SimCoProd01Replica02 -s SimCoProd01-z us-east-1a
                
                    
DBINSTANCE  simcoprod01replica02  db.m1.large  mysql  10  master  creating  
   us-east-1a  0  n  5.1.50  simcoprod01
SECGROUP  default  active
PARAMGRP  default.mysql5.1  in-sync