Several ways to get metadata (like ip address) when you're connected to an EC2:
/opt/aws/bin/ec2-metadata
curl http://169.254.169.254/latest/meta-data/
Une vue pratique pour comparer les instances ec2