Getting the IP Address of your EC2 instance with the AWS CLI

Zero dependencies. Zero fuss. Yes, it can be done.

Here’s how:

aws ec2 describe-instances --instance-id i-xxxxxxxxxxxxxxxx --query 'Reservations[].Instances[].PublicIpAddress' --output text