I\'m trying to use the Amazon AWS Command Line Tools to find all instances that do not have a specified tag.
Finding all instances WITH a tag is simple enough, e.g.<
Unfortunately the underlying api call DescribeSnapshots does not support inverse tag filtering, and so neither does the CLI. You can, however, do client side filtering with the --query
parameter which performs a JMESPath search. This will prevent you from having to use pipes as with user2616321's answer.
For example:
aws ec2 describe-instances --query "Reservations[].Instances[?Tags[?Key == 'Name']][]"
Add .InstanceId
to the end of that to just get the instance ids.