On reboot, the IP address of an amazon instance changes. How to find the new IP address using java API?
you Can Use This.
var ipofnewServer = string.Empty;
while (string.IsNullOrEmpty(ipofnewServer))
{
var statusRequest1 = new DescribeInstancesRequest
{
InstanceIds = new List() { instanceId }
};
var result = amazonEc2client.DescribeInstances(statusRequest1);
var status = result.Reservations[0].Instances.FirstOrDefault();
if (status != null)
{
ipofnewServer = status.PublicIpAddress;
}
}