How to find all instance Ids In AWS from command line

+1 vote

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, 2020 in AWS by akhtar
• 38,230 points
5,141 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. You can get a better understanding with the AWS Cloud Migration Training.

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, 2020 by MD
• 95,440 points

Related Questions In AWS

0 votes
1 answer

How to copy a snapshot in AWS from the command line?

Hi@akhtar, The following copy-snapshot example command copies the specified snapshot ...READ MORE

answered Oct 20, 2020 in AWS by MD
• 95,440 points
883 views
+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
• 58,090 points
1,972 views
0 votes
1 answer
0 votes
1 answer
–1 vote
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, 2020 in AWS by MD
• 95,440 points
612 views
0 votes
1 answer

How to check the state of the snapshot from the command line in AWS?

Hi@akhtar, You can check the state of the snapshot ...READ MORE

answered Oct 20, 2020 in AWS by MD
• 95,440 points
1,042 views
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