restore_db_instance_from_db_snapshot ( $db_instance_identifier, $db_snapshot_identifier, $opt )

Creates a new DB Instance from a DB snapshot. The target database is created from the source database restore point with the same configuration as the original source database, except that the new RDS instance is created with the default security group.

Access

public

Parameters

Parameter

Type

Required

Description

$db_instance_identifier

string

Required

The identifier for the DB Snapshot to restore from. 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

$db_snapshot_identifier

string

Required

Name of the DB Instance to create from the DB Snapshot. This parameter isn’t case sensitive. Constraints:

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

Example: my-snapshot-id

$opt

array

Optional

An associative array of parameters that can have the following keys:

  • DBInstanceClass - string - Optional - The compute and memory capacity of the Amazon RDS DB instance. Valid Values: db.t1.micro | db.m1.small | db.m1.medium | db.m1.large | db.m1.xlarge | db.m2.2xlarge | db.m2.4xlarge
  • Port - integer - Optional - The port number on which the database accepts connections. Default: The same port as the original DB Instance Constraints: Value must be 1150-65535
  • AvailabilityZone - string - Optional - The EC2 Availability Zone that the database instance will be created in. Default: A random, system-chosen Availability Zone. Constraint: You cannot specify the AvailabilityZone parameter if the MultiAZ parameter is set to true. Example: us-east-1a
  • DBSubnetGroupName - string - Optional - The DB Subnet Group name to use for the new instance.
  • MultiAZ - boolean - Optional - Specifies if the DB Instance is a Multi-AZ deployment. Constraint: You cannot specify the AvailabilityZone parameter if the MultiAZ parameter is set to true.
  • PubliclyAccessible - boolean - Optional -
  • AutoMinorVersionUpgrade - boolean - Optional - Indicates that minor version upgrades will be applied automatically to the DB Instance during the maintenance window.
  • LicenseModel - string - Optional - License model information for the restored DB Instance. Default: Same as source. Valid values: license-included | bring-your-own-license | general-public-license
  • DBName - string - Optional - The database name for the restored DB Instance.

    This parameter doesn’t apply to the MySQL engine.

  • Engine - string - Optional - The database engine to use for the new instance. Default: The same as source Constraint: Must be compatible with the engine of the source Example: oracle-ee
  • Iops - integer - Optional - The amount of Provisioned IOPS (input/output operations per second) to be initially allocated for the DB Instance. Constraints: Must be an integer greater than 1000.
  • OptionGroupName - string - 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

Type

Description

CFResponse

A CFResponse object containing a parsed HTTP response.

Examples

Restore a database instance from a database snapshot.

// Instantiate the class
$rds = new AmazonRDS();

$response = $rds->restore_db_instance_from_db_snapshot('mySnapshot', 'mySnapshot', array(
	'DBInstanceClass' => 'db.m1.small',
	'AutoMinorVersionUpgrade' => 'true'
));

// Success?
var_dump($response->isOK());

Related Methods

Source

Method defined in services/rds.class.php | Toggle source view (8 lines) | View on GitHub

public function restore_db_instance_from_db_snapshot($db_instance_identifier, $db_snapshot_identifier, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['DBInstanceIdentifier'] = $db_instance_identifier;
    $opt['DBSnapshotIdentifier'] = $db_snapshot_identifier;
    
    return $this->authenticate('RestoreDBInstanceFromDBSnapshot', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback