You are viewing documentation for version 1 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: AWS::RDS::DBInstanceCollection

Inherits:
Object
  • Object
show all
Includes:
Core::Collection::WithLimitAndNextToken
Defined in:
lib/aws/rds/db_instance_collection.rb

Instance Method Summary collapse

Methods included from Core::Collection

#each, #each_batch, #enum, #first, #in_groups_of, #page

Instance Method Details

#[](db_instance_id) ⇒ DBInstance

Returns a AWS::RDS::DBInstance with the given ID.

Parameters:

  • db_instance_id (String)

    The DB instance identifier. This should be a lowercase string.

Returns:



27
28
29
# File 'lib/aws/rds/db_instance_collection.rb', line 27

def [] db_instance_id
  DBInstance.new(db_instance_id.to_s.downcase, :config => config)
end

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

Creates a database instance. See Client#create_db_instance for documentation on the accepted (and required) options.

Parameters:

  • db_instance_id (String)

    The DB instance identifier. This should be a lowercase string.

  • options (Hash) (defaults to: {})

Returns:



38
39
40
41
42
43
44
45
46
47
# File 'lib/aws/rds/db_instance_collection.rb', line 38

def create db_instance_id, options = {}

  options[:db_instance_identifier] = db_instance_id

  resp = client.create_db_instance(options)

  DBInstance.new_from(:create_db_instance, resp,
    resp[:db_instance_identifier], :config => config)

end