#!/usr/bin/python
import sys
import boto3
client = boto3.client('elb')
def INSTANCEUNDERELB():
response = client.describe_instance_health(
LoadBalancerName=LBNAME,
)
INSTANCESTATUS=response.values()[0]
print(len(INSTANCESTATUS))
for i in INSTANCESTATUS:
print(i.values()[0]+" "+i.values()[2]+" "+i.values()[3])python
ELBLIST = client.describe_load_balancers(
PageSize=399
)
ELBLIST=(ELBLIST.values())
#print(len(ELBLIST))
#print(ELBLIST[0])import
for ELEMENT in ELBLIST[0]:
LBNAME=(ELEMENT["LoadBalancerName"])
print("#####################")
print(LBNAME)
print("----")
INSTANCEUNDERELB()cli