I have an instance named dev-server-03
. Now how can I search all dev-server-*
instances from command line?
I am using aws cli tool.
amazon ec2amazon-web-servicesaws-cli
I have an instance named dev-server-03
. Now how can I search all dev-server-*
instances from command line?
I am using aws cli tool.
Best Answer
Assuming that you are using the convention of putting the name of the instance in a tag with the key of "Name" (this is what the AWS Console does when you enter a name), then you can use the
--filters
option to list those instances with aws-cli:If you just wanted the instance ids of those instances, you could use:
Note:
--query
may require a recent version of aws-cli but it's worth getting.