Search code examples
amazon-web-servicesaws-cli

AWS CLI list all load balancers and their associated private/public IPs


As simple as it sounds, I am trying to get a list of all my load balancers (network, application, classic, gateways). Haven't been able to get the exact command to get that output from the aws cli.


Solution

  • Get load-balancer-ids with describe-load-balancers and then use describe-network-interfaces to get IPs:

    aws ec2 describe-network-interfaces --filters Name=description,Values="ELB elb-name" --query 'NetworkInterfaces[*].PrivateIpAddresses[*].PrivateIpAddress' --output text