Created
April 28, 2015 14:48
-
-
Save sebsto/eb48357f0bb24db8b2bf to your computer and use it in GitHub Desktop.
Find all instances without a specific tag / with a specific tag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws ec2 describe-instances --query 'Reservations[?Instances[?length(Tags[?Key==`Environment`]) == `0`]].Instances[].InstanceId' | |
aws ec2 describe-instances --query 'Reservations[?Instances[?Tags[?Key==`Environment`]]].Instances[].InstanceId' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment