How to find all ELB that are using specific subnet in AWS via CLI

+1 vote
I am trying to find all Elastic Load Balancers using this subnet via the AWS CLI.

I Tried this-aws --region us-east-1 elb describe-load-balancers --query 'LoadBalancerDescriptions[?Subnets==subnet-1234546]|[].LoadBalancerName'. But it resulted nothing. I think I am commiting some mistake while mentioning the subnet details.

Can any one help me ?
May 24, 2019 in AWS by code_ninja
• 6,300 points

edited May 31, 2019 by code_ninja 1,463 views

1 answer to this question.

+1 vote

In AWS CLI the correct way to reach any configured service, is to mention the  correct service description. The subnet syntax is not so correct so use the one mentioned below:

aws--region us east-1 elb describe-load-balancers --query 'LoadBalancerDescriptions[?contains(Subnets, `subnet-1234546`)==`true`].LoadBalancerName' --output text

for more CLI relateded issues check this- https://www.edureka.co/blog/aws-cli/

I hope this helps you

answered May 24, 2019 by ArchanaNagur
• 2,360 points

Related Questions In AWS

0 votes
1 answer

How to download the latest file in a S3 bucket using AWS CLI?

You can use the below command $ aws ...READ MORE

answered Sep 6, 2018 in AWS by Archana
• 4,170 points
19,890 views
0 votes
1 answer

How to exclude specific folders every time I run 'eb deploy' using AWS EB CLI

If there is not .ebignore file it ...READ MORE

answered Oct 24, 2018 in AWS by Priyaj
• 58,020 points
2,138 views
0 votes
1 answer
0 votes
1 answer

AWS EFS vs EBS vs S3 (differences & when to use?)

Parameters S3 EBS EFS Access Can be accessed publicly  Accessed only through given ...READ MORE

answered Aug 9, 2018 in AWS by ArchanaNagur
• 2,360 points
1,654 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP