Class: Builderator::Model::Cleaner::ScalingGroups
- Defined in:
- lib/builderator/model/cleaner/scaling_groups.rb
Overview
AutoScaling Group Resoruces
Constant Summary collapse
- PROPERTIES =
%w(auto_scaling_group_arn min_size max_size desired_capacity default_cooldown availability_zones load_balancer_names vpc_zone_identifier status termination_policies)
Instance Attribute Summary collapse
-
#resources ⇒ Object
readonly
Returns the value of attribute resources.
Instance Method Summary collapse
Methods inherited from Base
#find, #in_use, #in_use?, #initialize, #select, #unused
Constructor Details
This class inherits a constructor from Builderator::Model::Cleaner::Base
Instance Attribute Details
#resources ⇒ Object (readonly)
Returns the value of attribute resources.
16 17 18 |
# File 'lib/builderator/model/cleaner/scaling_groups.rb', line 16 def resources @resources end |
Instance Method Details
#fetch ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/builderator/model/cleaner/scaling_groups.rb', line 21 def fetch @resources = {}.tap do |i| Util.asg.describe_auto_scaling_groups.each do |page| page.auto_scaling_groups.each do |a| properties = Util.(a.) properties['creation_date'] = a.created_time.to_datetime PROPERTIES.each { |pp| properties[pp] = a[pp.to_sym] } i[a.launch_configuration_name] = { :id => a.auto_scaling_group_name, :properties => properties, :config => a.launch_configuration_name } end end end end |
#launch_configs ⇒ Object
39 40 41 |
# File 'lib/builderator/model/cleaner/scaling_groups.rb', line 39 def launch_configs resources.values.map { |g| g[:config] } end |