determine if instances are InService across a given load balancer and array of load balancers

This commit is contained in:
Anuj Biyani
2013-05-31 18:20:09 -07:00
parent 20b59fb132
commit 9273f748c2
4 changed files with 105 additions and 0 deletions

View File

@@ -24,4 +24,20 @@ class AwsHaRelease
@group.update(desired_capacity: @group.desired_capacity + 1)
end
def instances_inservice?(load_balancer)
load_balancer.instances.health.each do |health|
return false unless health[:state] == 'InService'
end
true
end
def all_instances_inservice?(load_balancers)
load_balancers.each do |load_balancer|
return false unless instances_inservice?(load_balancer)
end
true
end
end