On reboot, the IP address of an amazon instance changes. How to find the new IP address using java API?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming you don’t want to assign an Elastic IP address (and there are reasons why this is not always a solution) then simply call
DescribeInstanceson the rebooted instance, which returns a bunch of information including Public IP Address.Here’s the AWS EC2 Java API Documentation on the topic.