Skip to content

Instantly share code, notes, and snippets.

@aarondodd
Created February 28, 2018 18:43
Show Gist options
  • Save aarondodd/36e6207bb857f1e6bcfcd42971127218 to your computer and use it in GitHub Desktop.
Save aarondodd/36e6207bb857f1e6bcfcd42971127218 to your computer and use it in GitHub Desktop.
get public DNS of EC2 instances tagged with a certain value
aws ec2 describe-instances --region us-east-1 --filters "Name=tag:Group,Values=fancyapp1" --output json --query 'Reservations[*].Instances[*].{Name:Tags[?Key==`Name`].Value,PublicIP:PublicIpAddress}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment