如何找到在重新启动一个Amazon EC2实例的IP地址重新启动、实例、地址、Amazon

2023-09-11 08:15:05 作者:姐、不愿将就

在重新启动时,Amazon实例的IP地址的变化。如何使用Java API来寻找新的IP地址?

On reboot, the IP address of an amazon instance changes. How to find the new IP address using java API?

推荐答案

假设你不想分配弹性IP地址(也有原因,这并不总是一个解决方案),则只需拨打 DescribeInstances 在重新启动实例,返回一串信息,包括公网IP地址。

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 DescribeInstances on the rebooted instance, which returns a bunch of information including Public IP Address.

这里是的话题AWS EC2 Java API文档。

 
精彩推荐
图片推荐