Sha256: 88905bcfb19c5988aa4da482ec695bfeec35e43f5766e3224abd1a97a82672e1

Contents?: true

Size: 1.73 KB

Versions: 25

Compression:

Stored size: 1.73 KB

Contents

module Awspec::Helper
  module Finder
    module Autoscaling
      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

      def find_launch_configuration(id)
        res = autoscaling_client.describe_launch_configurations({
                                                                  launch_configuration_names: [id]
                                                                })
        res.launch_configurations.single_resource(id)
      end

      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

      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

      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
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
awspec-1.12.5 lib/awspec/helper/finder/autoscaling.rb
awspec-1.12.4 lib/awspec/helper/finder/autoscaling.rb
awspec-1.12.3 lib/awspec/helper/finder/autoscaling.rb
awspec-1.12.2 lib/awspec/helper/finder/autoscaling.rb
awspec-1.12.1 lib/awspec/helper/finder/autoscaling.rb
awspec-1.12.0 lib/awspec/helper/finder/autoscaling.rb
awspec-1.11.1 lib/awspec/helper/finder/autoscaling.rb
awspec-1.11.0 lib/awspec/helper/finder/autoscaling.rb
awspec-1.10.0 lib/awspec/helper/finder/autoscaling.rb
awspec-1.9.0 lib/awspec/helper/finder/autoscaling.rb
awspec-1.8.0 lib/awspec/helper/finder/autoscaling.rb
awspec-1.7.0 lib/awspec/helper/finder/autoscaling.rb
awspec-1.6.1 lib/awspec/helper/finder/autoscaling.rb
awspec-1.6.0 lib/awspec/helper/finder/autoscaling.rb
awspec-1.5.4 lib/awspec/helper/finder/autoscaling.rb
awspec-1.5.3 lib/awspec/helper/finder/autoscaling.rb
awspec-1.5.2 lib/awspec/helper/finder/autoscaling.rb
awspec-1.5.1 lib/awspec/helper/finder/autoscaling.rb
awspec-1.5.0 lib/awspec/helper/finder/autoscaling.rb
awspec-1.4.3 lib/awspec/helper/finder/autoscaling.rb