Skip to content

Instantly share code, notes, and snippets.

@ddossot
Created October 10, 2014 16:57
Show Gist options
  • Save ddossot/817541a3095c4222c121 to your computer and use it in GitHub Desktop.
Save ddossot/817541a3095c4222c121 to your computer and use it in GitHub Desktop.
A little helper to lookup AWS instances in one region: fetches by tag and returns public DNS name and tag values.
function aws-lookup() {
aws ec2 describe-instances --region $1 --filters "Name=tag:Name,Values=$2*" --query='Reservations[*].Instances[*].[PublicDnsName,Tags[*].Value]' --output text
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment