Skip to content

Instantly share code, notes, and snippets.

@zmx
Created March 2, 2020 07:57
Show Gist options
  • Save zmx/48e6ebadf19593c11e0a6cc163127750 to your computer and use it in GitHub Desktop.
Save zmx/48e6ebadf19593c11e0a6cc163127750 to your computer and use it in GitHub Desktop.
Get AWS EC2 instance IP address in /etc/hosts format
aws ec2 describe-instances --filters "Name=tag:Name,Values=bill*" --query 'Reservations[].Instances[].[PublicIpAddress,Tags[?Key==`Name`]| [0].Value]' --output text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment