To determine your instance's public IP address from within the instance, you can use instancemetadata. Use the following command to access the public IP address: For Linux use, $ curlhttp://169.254.169.254/latest/meta-data/public-ipv4, and for Windows use, $ wgethttp://169.254.169.254/latest/meta-data/public-ipv4. Reference: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html