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 in AWS by code_ninja
• 5,980 points

edited May 31 by code_ninja 25 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
+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 by ArchanaNagur
• 1,910 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,090 points
2,017 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 8, 2018 in AWS by ArchanaNagur
• 1,910 points
118 views
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.