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
• 6,220 points

edited May 31 by code_ninja 39 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 by ArchanaNagur
• 2,270 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
4,383 views
0 votes
1 answer
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
• 2,270 points
179 views
0 votes
1 answer