title: How to get a list of all public IPs and their instance names on Amazon EC2
body: <p>Anyone know how to get a list of all public IPs and their instance names on Amazon EC2 using aws CLI?</p>
  
  <p>This got me the list of public IPs, but not their associated instance names.
  aws ec2 describe-instances --query "Reservations[<em>].Instances[</em>].PublicIpAddress" --output text</p>
  
  <p>Thanks in advance.</p>