Creates a DB Instance that acts as a Read Replica of a source DB Instance.
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 as specified below.
The source DB Instance must have backup retention enabled.
Access
Parameters
Parameter |
Type |
Required |
Description |
$db_instance_identifier
|
string
|
Required
|
The 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. |
$source_db_instance_identifier
|
string
|
Required
|
The identifier of the DB Instance that will act as the source for the Read Replica. Each DB Instance can have up to five Read Replicas. Constraints: Must be the identifier of an existing DB Instance that is not already a Read Replica DB Instance. |
$opt
|
array
|
Optional
|
An associative array of parameters that can have the following keys:
DBInstanceClass - string - Optional - The compute and memory capacity of the Read Replica. Valid Values: db.m1.small | db.m1.medium | db.m1.large | db.m1.xlarge | db.m2.xlarge |db.m2.2xlarge | db.m2.4xlarge Default: Inherits from the source DB Instance.AvailabilityZone - string - Optional - The Amazon EC2 Availability Zone that the Read Replica will be created in. Default: A random, system-chosen Availability Zone in the endpoint’s region. Example: us-east-1d Port - integer - Optional - The port number that the DB Instance uses for connections. Default: Inherits from the source DB Instance Valid Values: 1150-65535 AutoMinorVersionUpgrade - boolean - Optional - Indicates that minor engine upgrades will be applied automatically to the Read Replica during the maintenance window. Default: Inherits from the source DB InstanceIops - integer - Optional - The amount of Provisioned IOPS (input/output operations per second) to be initially allocated for the DB Instance.OptionGroupName - string - Optional - The option group the DB instance will be associated with. If omitted, the default Option Group for the engine specified will be used.PubliclyAccessible - boolean - Optional - curlopts - array - Optional - A set of values to pass directly into curl_setopt() , where the key is a pre-defined CURLOPT_* constant.returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests. |
Returns
Examples
Create a database read replica.
// Instantiate the class
$rds = new AmazonRDS();
$response = $rds->create_db_instance_read_replica('myInstancereplica', 'myInstance', array(
'DBInstanceClass' => 'db.m1.small',
'AutoMinorVersionUpgrade' => true
));
// Success?
var_dump($response->isOK());
Result:
bool(true)
Related Methods
Source
Method defined in services/rds.class.php | Toggle source view (8 lines) | View on GitHub
public function create_db_instance_read_replica($db_instance_identifier, $source_db_instance_identifier, $opt = null)
{
if (!$opt) $opt = array();
$opt['DBInstanceIdentifier'] = $db_instance_identifier;
$opt['SourceDBInstanceIdentifier'] = $source_db_instance_identifier;
return $this->authenticate('CreateDBInstanceReadReplica', $opt);
}