Sha256: 3c4c892c652ddd6fcaa6c0272b9d0efd209f730489f9afaf249958b04ad1514a

Contents?: true

Size: 968 Bytes

Versions: 60

Compression:

Stored size: 968 Bytes

Contents

module Awspec::Type
  class Alb < ResourceBase
    def resource_via_client
      @resource_via_client ||= find_alb(@display_name)
    end

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

    STATES = %w(
      active provisioning failed
    )

    STATES.each do |state|
      define_method state + '?' do
        resource_via_client.state.code == state
      end
    end

    def has_security_group?(sg_id)
      sgs = resource_via_client.security_groups
      ret = sgs.find do |sg|
        sg == sg_id
      end
      return true if ret
      sg2 = find_security_group(sg_id)
      return true if sgs.include? sg2.group_id
      false
    end

    def has_subnet?(subnet_id)
      azs = resource_via_client.availability_zones
      ret = azs.find do |az|
        az.subnet_id == subnet_id
      end
      return true if ret
      subnet2 = find_subnet(subnet_id)
      subnet2.subnet_id = subnet_id
    end
  end
end

Version data entries

60 entries across 60 versions & 2 rubygems

Version Path
awspec-1.3.0 lib/awspec/type/alb.rb
awspec-1.2.0 lib/awspec/type/alb.rb
awspec-1.1.0 lib/awspec/type/alb.rb
awspec-1.0.0 lib/awspec/type/alb.rb
awspec-1.0.0.rc lib/awspec/type/alb.rb
awspec-0.88.2 lib/awspec/type/alb.rb
awspec-0.88.1 lib/awspec/type/alb.rb
awspec-0.88.0 lib/awspec/type/alb.rb
awspec-0.87.1 lib/awspec/type/alb.rb
awspec-0.87.0 lib/awspec/type/alb.rb
awspec-0.86.0 lib/awspec/type/alb.rb
cmonson_2ndwatch_awspec-0.85.4 lib/awspec/type/alb.rb
awspec-0.85.3 lib/awspec/type/alb.rb
cmonson_2ndwatch_awspec-0.85.3 lib/awspec/type/alb.rb
awspec-0.85.2 lib/awspec/type/alb.rb
awspec-0.85.1 lib/awspec/type/alb.rb
awspec-0.85.0 lib/awspec/type/alb.rb
awspec-0.84.1 lib/awspec/type/alb.rb
awspec-0.84.0 lib/awspec/type/alb.rb
awspec-0.83.0 lib/awspec/type/alb.rb