Class: Comodule::Deployment::Helper::Aws::Rds::Db

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/comodule/deployment/helper/aws/rds.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Base

included

Constructor Details

#initialize(platform, db_instance_identifier) ⇒ Db

Returns a new instance of Db.



32
33
34
35
# File 'lib/comodule/deployment/helper/aws/rds.rb', line 32

def initialize(platform, db_instance_identifier)
  self.owner = platform
  self.db = aws.rds.db_instances[db_instance_identifier]
end

Instance Attribute Details

#dbObject

Returns the value of attribute db.



30
31
32
# File 'lib/comodule/deployment/helper/aws/rds.rb', line 30

def db
  @db
end

Instance Method Details

#latest_automated_snapshotObject



37
38
39
40
41
42
43
44
# File 'lib/comodule/deployment/helper/aws/rds.rb', line 37

def latest_automated_snapshot
  snapshot =
    db.snapshots.with_type('automated').sort do |a, b|
      b.created_at <=> a.created_at
    end

  snapshot.first.db_snapshot_identifier
end