Skip to content

Instantly share code, notes, and snippets.

@memoryleak
Created April 14, 2020 12:23
Show Gist options
  • Save memoryleak/181b9613ad31d8ec5f5d61cb2c530ccf to your computer and use it in GitHub Desktop.
Save memoryleak/181b9613ad31d8ec5f5d61cb2c530ccf to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
FILTER="$1-*"
aws ec2 --output table describe-instances \
--filters "Name=tag:Name,Values=$FILTER" \
--query 'Reservations[].Instances[].{Name:Tags[?Key==`Name`]|[0].Value,Address:PrivateIpAddress}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment