class Stax::Cmd::Alb

Constants

COLORS

Public Instance Methods

dns() click to toggle source
# File lib/stax/mixin/alb.rb, line 28
def dns
  puts Aws::Alb.describe(stack_albs.map(&:physical_resource_id)).map(&:dns_name)
end
stack_albs() click to toggle source
# File lib/stax/mixin/alb.rb, line 22
def stack_albs
  Aws::Cfn.resources_by_type(my.stack_name, 'AWS::ElasticLoadBalancingV2::LoadBalancer')
end
status() click to toggle source
# File lib/stax/mixin/alb.rb, line 33
def status
  stack_albs.each do |alb|
    Aws::Alb.target_groups(alb.physical_resource_id).each do |t|
      debug("ALB status for #{alb.logical_resource_id} #{t.protocol}:#{t.port} #{t.target_group_name}")
      print_table Aws::Alb.target_health(t.target_group_arn).map { |h|
        [h.target.id, h.target.port, color(h.target_health.state, COLORS), h.target_health.reason, h.target_health.description]
      }
    end
  end
end