-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Adding ELB waiter for healthy instance #716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I was just hoping to wait for one of them to be in the success state, should I change then name? I could also add one for checking if they are all healthy. |
The name is fine. It should match "all" of the requested instances are healthy. You control what all means by omitting the instance if list or providing one or more odd. Does that make sense? |
Yeah, it makes sense, but it doesn't exactly cover the use case I had in mind. I'm creating a number of new instances to replace the ones currently attached to an ELB. One instance can handle all of the load coming through by itself, but I am starting additional instances for high availability purposes. I was hoping to start the process of deregistering and terminating the old instances once any number of the new instances become available through the load balancer. Do you think that this use case could warrant having a waiter for |
Maybe my confusion is the intended use of the waiter. Do you intend to wait until any of the instances are "InService" and use this as a condition to indicate the health of the load balancer? If so, maybe its just naming confusion. My suggestion:
Example: # poll until EVERY instance is in service
elb.wait_until(:instance_in_service)
# polls until both instances are in service
elb.wait_until(:instance_in_service, instances: [{ instance_id: 'id' }, { instance_id: 'id2'}])
# poll until ANY instance is in service
elb.wait_until(:any_instance_in_service)
# polls until any of the two instances are in service
elb.wait_until(:any_instance_in_service, instances: [{ instance_id: 'id' }, { instance_id: 'id2'}]) Does that cover your use cases? |
Exactly what I was looking for, thanks for the naming suggestion! |
1 similar comment
Adding ELB waiter for healthy instance
Thanks for the contribution! |
Adding a waiter that takes an ELB name and list of instance_ids and returns success when at least one of them reports back as "InService".