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.<
You can do that with jmespath (the engine that drives the --query parameter) despite what others say:
aws ec2 describe-instances \
--query 'Reservations[].Instances[?!not_null(Tags[?Key == `Name`].Value)] | []'
Source: Using Amazon Web Services Command Line Interface (AWS CLI) to Find Instances without a 'Name' Tag.