如何在重启时找到亚马逊 EC2 实例的 IP 地址 [英] How to find the IP address of an amazon EC2 instance on reboot

查看:31
本文介绍了如何在重启时找到亚马逊 EC2 实例的 IP 地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

重新启动时,亚马逊实例的 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 文档.

这篇关于如何在重启时找到亚马逊 EC2 实例的 IP 地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆