Module: Awspec::Helper::Finder::Autoscaling
- Included in:
- Awspec::Helper::Finder
- Defined in:
- lib/awspec/helper/finder/autoscaling.rb
Instance Method Summary collapse
- #find_autoscaling_group(id) ⇒ Object
- #find_block_device_mapping(id, device_id) ⇒ Object
- #find_launch_configuration(id) ⇒ Object
- #select_alb_target_group_by_autoscaling_group_name(name) ⇒ Object
- #select_lb_target_group_by_autoscaling_group_name(name) ⇒ Object
Instance Method Details
#find_autoscaling_group(id) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/awspec/helper/finder/autoscaling.rb', line 4 def find_autoscaling_group(id) res = autoscaling_client.describe_auto_scaling_groups({ auto_scaling_group_names: [id] }) res.auto_scaling_groups.single_resource(id) end |
#find_block_device_mapping(id, device_id) ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/awspec/helper/finder/autoscaling.rb', line 32 def find_block_device_mapping(id, device_id) ret = find_launch_configuration(id).block_device_mappings.select do |device| next true if device.device_name == device_id next true if device.virtual_name == device_id end ret.single_resource(device_id) end |
#find_launch_configuration(id) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/awspec/helper/finder/autoscaling.rb', line 11 def find_launch_configuration(id) res = autoscaling_client.describe_launch_configurations({ launch_configuration_names: [id] }) res.launch_configurations.single_resource(id) end |
#select_alb_target_group_by_autoscaling_group_name(name) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/awspec/helper/finder/autoscaling.rb', line 18 def select_alb_target_group_by_autoscaling_group_name(name) res = autoscaling_client.describe_load_balancer_target_groups({ auto_scaling_group_name: name }) res.load_balancer_target_groups end |
#select_lb_target_group_by_autoscaling_group_name(name) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/awspec/helper/finder/autoscaling.rb', line 25 def select_lb_target_group_by_autoscaling_group_name(name) res = autoscaling_client.describe_load_balancer_target_groups({ auto_scaling_group_name: name }) res.load_balancer_target_groups end |