Class: Comodule::Deployment::Helper::Aws::Rds::Db
- Inherits:
-
Object
- Object
- Comodule::Deployment::Helper::Aws::Rds::Db
- Includes:
- Base
- Defined in:
- lib/comodule/deployment/helper/aws/rds.rb
Instance Attribute Summary collapse
-
#db ⇒ Object
Returns the value of attribute db.
Instance Method Summary collapse
-
#initialize(platform, db_instance_identifier) ⇒ Db
constructor
A new instance of Db.
- #latest_automated_snapshot ⇒ Object
Methods included from Base
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
#db ⇒ Object
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_snapshot ⇒ Object
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 |