class AWS::RDS::DBInstance

@attr_reader [String] db_instance_class

@attr_reader [String] engine

@attr_reader [String] db_instance_status

@attr_reader [String] master_username

@attr_reader [String] db_name

@attr_reader [String] endpoint_address

@attr_reader [Integer] endpoint_port

@attr_reader [Integer] allocated_storage

@attr_reader [Time] creation_date_time

@attr_reader [String] preferred_backup_window

@attr_reader [Integer] backup_retention_period

@attr_reader [String] availability_zone_name

@attr_reader [String] preferred_maintenance_window

@attr_reader [Time] latest_restorable_time

@attr_reader [Boolean] multi_az

@attr_reader [Integer] iops

@attr_reader [String] engine_version

@attr_reader [Boolean] auto_minor_version_upgrade

@attr_reader [String] read_replica_source_db_instance_identifier

@attr_reader [Array<String>] read_replica_db_instance_identifiers

@attr_reader [String] license_model

@attr_reader [String] character_set_name

@attr_reader [String,nil] vpc_id

Attributes

db_instance_id[R]

@return [String]

db_instance_identifier[R]

@return [String]

id[R]

@return [String]

Public Class Methods

new(db_instance_id, options = {}) click to toggle source

@param [String] #db_instance_id @param [Hash] options

Calls superclass method AWS::Core::Resource.new
# File lib/aws/rds/db_instance.rb, line 68
def initialize db_instance_id, options = {}
  @db_instance_identifier = db_instance_id
  super
end

Public Instance Methods

create_snapshot(db_snapshot_id) click to toggle source

@return [DBSnapshot]

# File lib/aws/rds/db_instance.rb, line 164
def create_snapshot db_snapshot_id

  options = {}
  options[:db_snapshot_identifier] = db_snapshot_id
  options[:db_instance_identifier] = db_instance_identifier
  resp = client.create_db_snapshot(options)

  DBSnapshot.new_from(:create_db_snapshot, resp,
    resp[:db_snapshot_identifier], :config => config)

end
delete(options = {}) click to toggle source

Terminates (deletes) this database instance. @return [nil]

# File lib/aws/rds/db_instance.rb, line 189
def delete options = {}
  client.delete_db_instance(options.merge(:db_instance_identifier => id))
  nil
end
exists?() click to toggle source

@return [Boolean] Returns `true` if the db instance exists.

# File lib/aws/rds/db_instance.rb, line 195
def exists?
  begin
    get_resource
    true
  rescue AWS::RDS::Errors::DBInstanceNotFound
    false
  end
end
modify(options = {}) click to toggle source

Modifies the database instance. @note You do not need to set `:db_instance_identifier`. @see Client#modify_db_instance @param (see Client#modify_db_instance)

# File lib/aws/rds/db_instance.rb, line 154
def modify options = {}
  client.modify_db_instance(options.merge(:db_instance_identifier => id))
end
reboot(options = {}) click to toggle source

Reboots this databse instance. @param [Hash] options @option options [Boolean] :force_failover When `true`, the reboot will be

conducted through a MultiAZ failover. Constraint: You cannot
specify `true` if the instance is not configured for MultiAZ.

@return [nil]

# File lib/aws/rds/db_instance.rb, line 182
def reboot options = {}
  client.reboot_db_instance(options.merge(:db_instance_identifier => id))
  nil
end
snapshots() click to toggle source

@return [DBSnapshotCollection]

# File lib/aws/rds/db_instance.rb, line 159
def snapshots
  DBSnapshotCollection.new(:config => config).db_instance(self)
end
vpc() click to toggle source

@return [EC2::VPC,nil]

# File lib/aws/rds/db_instance.rb, line 144
def vpc
  if vpc_id
    EC2::VPC.new(vpc_id, :config => config)
  end
end

Protected Instance Methods

get_resource(attr = nil) click to toggle source
# File lib/aws/rds/db_instance.rb, line 210
def get_resource attr = nil
  client.describe_db_instances(:db_instance_identifier => id)
end
resource_identifiers() click to toggle source
# File lib/aws/rds/db_instance.rb, line 206
def resource_identifiers
  [[:db_instance_identifier, id]]
end