Class: AWS::RDS::DBInstance

Inherits:
Core::Resource
  • Object
show all
Defined in:
lib/aws/rds/db_instance.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(db_instance_id, options = {}) ⇒ DBInstance



66
67
68
69
# File 'lib/aws/rds/db_instance.rb', line 66

def initialize db_instance_id, options = {}
  @db_instance_identifier = db_instance_id
  super
end

Instance Attribute Details

#allocated_storageInteger (readonly)



62
63
64
# File 'lib/aws/rds/db_instance.rb', line 62

def allocated_storage
  @allocated_storage
end

#auto_minor_version_upgradeBoolean (readonly)



62
63
64
# File 'lib/aws/rds/db_instance.rb', line 62

def auto_minor_version_upgrade
  @auto_minor_version_upgrade
end

#availability_zone_nameString (readonly)



62
63
64
# File 'lib/aws/rds/db_instance.rb', line 62

def availability_zone_name
  @availability_zone_name
end

#backup_retention_periodInteger (readonly)



62
63
64
# File 'lib/aws/rds/db_instance.rb', line 62

def backup_retention_period
  @backup_retention_period
end

#character_set_nameString (readonly)



62
63
64
# File 'lib/aws/rds/db_instance.rb', line 62

def character_set_name
  @character_set_name
end

#creation_date_timeTime (readonly)



62
63
64
# File 'lib/aws/rds/db_instance.rb', line 62

def creation_date_time
  @creation_date_time
end

#db_instance_classString (readonly)



62
63
64
# File 'lib/aws/rds/db_instance.rb', line 62

def db_instance_class
  @db_instance_class
end

#db_instance_identifierString (readonly) Also known as: id, db_instance_id



72
73
74
# File 'lib/aws/rds/db_instance.rb', line 72

def db_instance_identifier
  @db_instance_identifier
end

#db_instance_statusString (readonly)



62
63
64
# File 'lib/aws/rds/db_instance.rb', line 62

def db_instance_status
  @db_instance_status
end

#db_nameString (readonly)



62
63
64
# File 'lib/aws/rds/db_instance.rb', line 62

def db_name
  @db_name
end

#endpoint_addressString (readonly)



62
63
64
# File 'lib/aws/rds/db_instance.rb', line 62

def endpoint_address
  @endpoint_address
end

#endpoint_portInteger (readonly)



62
63
64
# File 'lib/aws/rds/db_instance.rb', line 62

def endpoint_port
  @endpoint_port
end

#engineString (readonly)



62
63
64
# File 'lib/aws/rds/db_instance.rb', line 62

def engine
  @engine
end

#engine_versionString (readonly)



62
63
64
# File 'lib/aws/rds/db_instance.rb', line 62

def engine_version
  @engine_version
end

#iopsInteger (readonly)



62
63
64
# File 'lib/aws/rds/db_instance.rb', line 62

def iops
  @iops
end

#latest_restorable_timeTime (readonly)



62
63
64
# File 'lib/aws/rds/db_instance.rb', line 62

def latest_restorable_time
  @latest_restorable_time
end

#license_modelString (readonly)



62
63
64
# File 'lib/aws/rds/db_instance.rb', line 62

def license_model
  @license_model
end

#master_usernameString (readonly)



62
63
64
# File 'lib/aws/rds/db_instance.rb', line 62

def master_username
  @master_username
end

#multi_azBoolean (readonly)



62
63
64
# File 'lib/aws/rds/db_instance.rb', line 62

def multi_az
  @multi_az
end

#preferred_backup_windowString (readonly)



62
63
64
# File 'lib/aws/rds/db_instance.rb', line 62

def preferred_backup_window
  @preferred_backup_window
end

#preferred_maintenance_windowString (readonly)



62
63
64
# File 'lib/aws/rds/db_instance.rb', line 62

def preferred_maintenance_window
  @preferred_maintenance_window
end

#read_replica_db_instance_identifiersArray<String> (readonly)



62
63
64
# File 'lib/aws/rds/db_instance.rb', line 62

def read_replica_db_instance_identifiers
  @read_replica_db_instance_identifiers
end

#read_replica_source_db_instance_identifierString (readonly)



62
63
64
# File 'lib/aws/rds/db_instance.rb', line 62

def read_replica_source_db_instance_identifier
  @read_replica_source_db_instance_identifier
end

Instance Method Details

#create_snapshot(db_snapshot_id) ⇒ DBSnapshot



153
154
155
156
157
158
159
160
161
162
163
# File 'lib/aws/rds/db_instance.rb', line 153

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 = {}) ⇒ nil

Terminates (deletes) this database instance.



178
179
180
181
# File 'lib/aws/rds/db_instance.rb', line 178

def delete options = {}
  client.delete_db_instance(options.merge(:db_instance_identifier => id))
  nil
end

#exists?Boolean



184
185
186
187
188
189
190
191
# File 'lib/aws/rds/db_instance.rb', line 184

def exists?
  begin
    get_resource
    true
  rescue AWS::RDS::Errors::DBInstanceNotFound
    false
  end
end

#modify(options = {}) ⇒ Object

Note:

You do not need to set :db_instance_identifier.

Modifies the database instance.



143
144
145
# File 'lib/aws/rds/db_instance.rb', line 143

def modify options = {}
  client.modify_db_instance(options.merge(:db_instance_identifier => id))
end

#reboot(options = {}) ⇒ nil

Reboots this databse instance.

Options Hash (options):

  • :force_failover (Boolean)

    When true, the reboot will be conducted through a MultiAZ failover. Constraint: You cannot specify true if the instance is not configured for MultiAZ.



171
172
173
174
# File 'lib/aws/rds/db_instance.rb', line 171

def reboot options = {}
  client.reboot_db_instance(options.merge(:db_instance_identifier => id))
  nil
end

#snapshotsDBSnapshotCollection



148
149
150
# File 'lib/aws/rds/db_instance.rb', line 148

def snapshots
  DBSnapshotCollection.new(:config => config).db_instance(self)
end