Sha256: 4576446f27e7c116c6f2146f3e615986cf2f27085fddaa06cf41971a6a67c294

Contents?: true

Size: 823 Bytes

Versions: 8

Compression:

Stored size: 823 Bytes

Contents

module Awspec::Type
  class AutoscalingGroup < ResourceBase
    aws_resource Aws::AutoScaling::AutoScalingGroup
    tags_allowed

    def resource_via_client
      @resource_via_client ||= find_autoscaling_group(@display_name)
    end

    def id
      @id ||= resource_via_client.auto_scaling_group_arn if resource_via_client
    end

    def has_elb?(name)
      resource_via_client.load_balancer_names.find do |lb_name|
        lb_name == name
      end
    end

    def has_ec2?(id)
      ec2 = find_ec2(id)
      return nil unless ec2
      resource_via_client.instances.find do |instance|
        instance.instance_id = ec2.instance_id
      end
    end

    def has_suspended_process?(id)
      resource_via_client.suspended_processes.find do |process|
        process.process_name == id
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
awspec-0.84.0 lib/awspec/type/autoscaling_group.rb
awspec-0.83.0 lib/awspec/type/autoscaling_group.rb
awspec-0.82.3 lib/awspec/type/autoscaling_group.rb
awspec-0.82.2 lib/awspec/type/autoscaling_group.rb
awspec-0.82.1 lib/awspec/type/autoscaling_group.rb
awspec-0.82.0 lib/awspec/type/autoscaling_group.rb
awspec-0.81.1 lib/awspec/type/autoscaling_group.rb
awspec-0.81.0 lib/awspec/type/autoscaling_group.rb