Sha256: 8898d061402b1cd22475436e472be8d7e0d2685057e82758a946e4ac44dec9f0

Contents?: true

Size: 702 Bytes

Versions: 5

Compression:

Stored size: 702 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
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
awspec-0.82.3 lib/awspec/type/alb.rb
awspec-0.82.2 lib/awspec/type/alb.rb
awspec-0.82.1 lib/awspec/type/alb.rb
awspec-0.82.0 lib/awspec/type/alb.rb
awspec-0.81.1 lib/awspec/type/alb.rb