How to find all instance Ids In AWS from command line?

0 votes

Hi Guys,

I have installed AWS CLI in my Windows system. I am trying to find all the instance Ids from command line. How can I do this?

Jun 2 in AWS by akhtar
• 14,790 points
52 views

1 answer to this question.

0 votes

Hi@akhtar,

You can find one keyword --query in your AWS CLI. This keyword allows you to find particular values. You can use the blow given example. It will find all the InstacncId and ImageId.

C:\Users\NADIM AKTHAR>aws ec2 describe-instances  --query Reservations[*].Instances[*].[InstanceId,ImageId]
[
    [
        [
            "i-06e0d316abeb7fca4",
            "ami-0447a12f28fddb066"
        ]
    ],
    [
        [
            "i-0995dbee8a1dd7169",
            "ami-0447a12f28fddb066"
        ]
    ]
]

Hope this will give you some idea.

answered Jun 2 by MD
• 33,220 points

Related Questions In AWS

+1 vote
1 answer

How to clear all data from AWS CloudSearch?

Best answer I've been able to find ...READ MORE

answered Jul 20, 2018 in AWS by Priyaj
• 57,530 points
499 views
0 votes
2 answers

How to test credentials for AWS Command Line Tools

This command always works regardless of the ...READ MORE

answered Aug 8, 2018 in AWS by anonymous
1,401 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to find AWS instance Ids in yaml format from command line?

Hi@akhtar, By default AWS gives output in json ...READ MORE

answered Jun 2 in AWS by MD
• 33,220 points
42 views