0

I'll try and make this simple as possible.

Setting up a complex environment with multiple ELB's with AutoScaling linked to each other, external>internal>internal.

Simple singular ELB's with min 2 instances, 1 az each.

For something additional I need to do, I'd like to be able to query the HealthyHostCount of the first ELB and be able to get a number of currently running instances.

Had a quick look through the aws cli and I'm not sure I can't seem to workout how to do this, short of a convoluted query eg. --describe-instance-health and getting the array length.

Am I missing soething, is there a way to simply grab the current metric for an ELB's HealthyHostCount?

  • Not sure if this previous answer http://stackoverflow.com/questions/36146658/aws-cli-list-unused-elb/36159928#36159928 covers it but may well be worth a look – Vorsprung Apr 12 '16 at 14:25

1 Answers1

0

Knowing the number of instances in service on an ELB is a useful metric to have, however the most efficient way to determine this is to use the --describe-instance-health switch you mentioned.

Counting the number objects in the InstanceStates array is trivial; since you can obtain that information directly from the array, returning that metric as a separate key/value in the json would just add additional unnecessary size to the response which, at the scale of AWS, could be a significant amount of unnecessary traffic. The cli gives you the array of instances and their info, you get to do what you want with that.

hephalump
  • 5,860
  • 1
  • 22
  • 23