lib/rds/right_rds_interface.rb
# Create a DB Instance that acts as a Read Replica of a source DB Instance.
#
# Optional params: +:endpoint_port+, +:availability_zone+, +:instance_class+, +:auto_minor_version_upgrade+,
# +:iops+, +:option_group_name+
#
#    rds.create_db_instance_read_replica('kd-delete-me-01-replica-01', 'kd-delete-me-01',
#                                        :instance_class => 'db.m1.small',
#                                        :endpoint_port => '11000',
#                                        :auto_minor_version_upgrade => false ) #=>
#      {:auto_minor_version_upgrade=>false,
#       :read_replica_source_db_instance_identifier=>"kd-delete-me-01",
#       :status=>"creating",
#       :backup_retention_period=>0,
#       :allocated_storage=>30,
#       :read_replica_db_instance_identifiers=>[],
#       :engine_version=>"5.1.50",
#       :aws_id=>"kd-delete-me-01-replica-01",
#       :multi_az=>false,
#       :preferred_maintenance_window=>"sun:06:00-sun:10:00",
#       :master_username=>"username",
#       :preferred_backup_window=>"02:00-04:00",
#       :db_parameter_group=>{:status=>"in-sync", :name=>"default.mysql5.1"},
#       :engine=>"mysql",
#       :db_security_groups=>[{:status=>"active", :name=>"default"}],
#       :instance_class=>"db.m1.small",
#       :pending_modified_values=>{}}
#
Create a DB Instance that acts as a Read Replica of a source DB Instance.


Create a DB Instance that acts as a Read Replica of a source DB Instance .
def create_db_instance_read_replica(aws_id, source_db_instance_identifier, params={})
      request_hash = { 'DBInstanceIdentifier'       => aws_id,
                       'SourceDBInstanceIdentifier' => source_db_instance_identifier}
      request_hash['Port']                    = params[:endpoint_port]                   unless params[:endpoint_port].right_blank?
      request_hash['AvailabilityZone']        = params[:availability_zone]               unless params[:availability_zone].right_blank?
      request_hash['DBInstanceClass']         = params[:instance_class]                  unless params[:instance_class].right_blank?
      request_hash['AutoMinorVersionUpgrade'] = params[:auto_minor_version_upgrade].to_s unless params[:auto_minor_version_upgrade].nil?
      request_hash['Iops']                    = params[:iops]                            unless params[:iops].right_blank?
      request_hash['OptionGroupName']         = params[:option_group_name]               unless params[:option_group_name].right_blank?
      link = generate_request('CreateDBInstanceReadReplica', request_hash)
      request_info(link, DescribeDbInstancesParser.new(:logger => @logger))[:db_instances].first
    end
def create_db_instance_read_replica ( aws_id , source_db_instance_identifier , params = { } ) request_hash = { 'DBInstanceIdentifier' => aws_id , 'SourceDBInstanceIdentifier' => source_db_instance_identifier } request_hash [ 'Port' ] = params [ :endpoint_port ] unless params [ :endpoint_port ] . right_blank? request_hash [ 'AvailabilityZone' ] = params [ :availability_zone ] unless params [ :availability_zone ] . right_blank? request_hash [ 'DBInstanceClass' ] = params [ :instance_class ] unless params [ :instance_class ] . right_blank? request_hash [ 'AutoMinorVersionUpgrade' ] = params [ :auto_minor_version_upgrade ] . to_s unless params [ :auto_minor_version_upgrade ] . nil? request_hash [ 'Iops' ] = params [ :iops ] unless params [ :iops ] . right_blank? request_hash [ 'OptionGroupName' ] = params [ :option_group_name ] unless params [ :option_group_name ] . right_blank? link = generate_request ( 'CreateDBInstanceReadReplica' , request_hash ) request_info ( link , DescribeDbInstancesParser . new ( :logger => @logger ) ) [ :db_instances ] . first end
Create a DB Instance that acts as a Read Replica of a source DB Instance.
Create a DB Instance that acts as a Read Replica of a source DB Instance .
aws_id
<not_specific>
source_db_instance_identifier
<not_specific>
params
<not_specific>