class Awspec::Type::Alb

Constants

STATES

Public Instance Methods

has_security_group?(sg_id) click to toggle source
# File lib/awspec/type/alb.rb, line 25
def has_security_group?(sg_id)
  check_existence
  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
has_subnet?(subnet_id) click to toggle source
# File lib/awspec/type/alb.rb, line 39
def has_subnet?(subnet_id)
  check_existence
  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)
  azs.find do |az|
    az.subnet_id == subnet2.subnet_id
  end
end
has_tag?(tag_key, tag_value) click to toggle source
# File lib/awspec/type/alb.rb, line 53
def has_tag?(tag_key, tag_value)
  alb_arn = resource_via_client.load_balancer_arn
  tag_set = select_all_alb_tags(alb_arn)
  tag_set.find do |tag|
    tag.key == tag_key && tag.value == tag_value
  end
end
id() click to toggle source
# File lib/awspec/type/alb.rb, line 10
def id
  @id ||= resource_via_client.load_balancer_name if resource_via_client
end
resource_via_client() click to toggle source
# File lib/awspec/type/alb.rb, line 6
def resource_via_client
  @resource_via_client ||= find_alb(@display_name)
end