Sha256: a8745e61c67a527f1beda36a23e0b7297d69da8303e702d45cb265fc30f148ec

Contents?: true

Size: 1.38 KB

Versions: 17

Compression:

Stored size: 1.38 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 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

17 entries across 17 versions & 2 rubygems

Version Path
awspec-1.2.0 lib/awspec/helper/finder/autoscaling.rb
awspec-1.1.0 lib/awspec/helper/finder/autoscaling.rb
awspec-1.0.0 lib/awspec/helper/finder/autoscaling.rb
awspec-1.0.0.rc lib/awspec/helper/finder/autoscaling.rb
awspec-0.88.2 lib/awspec/helper/finder/autoscaling.rb
awspec-0.88.1 lib/awspec/helper/finder/autoscaling.rb
awspec-0.88.0 lib/awspec/helper/finder/autoscaling.rb
awspec-0.87.1 lib/awspec/helper/finder/autoscaling.rb
awspec-0.87.0 lib/awspec/helper/finder/autoscaling.rb
awspec-0.86.0 lib/awspec/helper/finder/autoscaling.rb
cmonson_2ndwatch_awspec-0.85.4 lib/awspec/helper/finder/autoscaling.rb
awspec-0.85.3 lib/awspec/helper/finder/autoscaling.rb
cmonson_2ndwatch_awspec-0.85.3 lib/awspec/helper/finder/autoscaling.rb
awspec-0.85.2 lib/awspec/helper/finder/autoscaling.rb
awspec-0.85.1 lib/awspec/helper/finder/autoscaling.rb
awspec-0.85.0 lib/awspec/helper/finder/autoscaling.rb
awspec-0.84.1 lib/awspec/helper/finder/autoscaling.rb