Skip to content

Instantly share code, notes, and snippets.

@mr-daydream
Created December 8, 2016 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mr-daydream/cb1d833cb4be24dcf2d51b6e44cb876a to your computer and use it in GitHub Desktop.
Save mr-daydream/cb1d833cb4be24dcf2d51b6e44cb876a to your computer and use it in GitHub Desktop.
List out InstanceID or PrivateIP of all AWS instances with a certain name (requires the aws-cli and jq packages)
aws ec2 describe-instances --filters "Name=tag:Name,Values=<regex>" | jq '.Reservations[].Instances[].InstanceId'
aws ec2 describe-instances --filters "Name=tag:Name,Values=<regex>" | jq '.Reservations[].Instances[].PrivateIpAddress'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment