aws: boto3 get all instances of a load balancers

时光毁灭记忆、已成空白 提交于 2019-12-05 22:19:06

Classic Load Balancer

Use: client = boto3.client('elb')

Then describe_load_balancers() results include a list of instances:

        'Instances': [
            {
                'InstanceId': 'string'
            },
        ],

Application Load Balancer

Use: client = boto3.client('elbv2')

Here is a sample response:

{
    'TargetHealthDescriptions': [
        {
            'Target': {
                'Id': 'i-0f76fade',
                'Port': 80,
            },
...
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!