bin/check-ecs-service-health.rb
# Unhealthy if service has fewer running tasks than desired
Unhealthy if service has fewer running tasks than desired
Unhealthy if service has fewer running tasks than desired
def services_by_health(cluster = 'default', services = nil, primary_status = false)
    bucket = nil
    service_details(cluster, services).group_by do |service|
      if primary_status
        service.deployments.each do |x|
          if x[:status].include? 'PRIMARY'
            bucket = bucket_service(x[:running_count], x[:desired_count])
          end
        end
      else
        bucket = bucket_service(service[:running_count], service[:desired_count])
      end
      bucket
    end
  end
def services_by_health ( cluster = 'default' , services = nil , primary_status = false ) bucket = nil service_details ( cluster , services ) . group_by do | service | if primary_status service . deployments . each do | x | if x [ :status ] . include? 'PRIMARY' bucket = bucket_service ( x [ :running_count ] , x [ :desired_count ] ) end end else bucket = bucket_service ( service [ :running_count ] , service [ :desired_count ] ) end bucket end end
Unhealthy if service has fewer running tasks than desired
Unhealthy if service has fewer running tasks than desired
cluster
<not_specific>
services
<not_specific>
primary_status
<not_specific>