Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (12.9k points)

How can I get list of only running instances when using ec2-describe-tags. I am using my command like this:

ec2-describe-tags --filter "resource-type=instance" --filter "value=somevalue" --filter "key=key"

1 Answer

0 votes
by (18.2k points)

Use the following command to get the list of only running instances with describe tags:

aws ec2 describe-instances --query 'Reservations[*].Instances[*].[InstanceId]' --filters Name=instance-state-name,Values=running --output text

Learn more about AWS by going through AWS course and master this trending technology.

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer

Browse Categories

...