-1

I launched a micro instance on Amazon EC2, it was assigned a public IP which was picked up from a pool of available IP basically DHCP.

Now I want to assign a static IP to this instance.

EC2 to has a way of doing this but with that approach I will loose the current IP address and I will be given a new one, the problem is I have used the current IP address in all my code.

So is there a way in which the IP address assigned to the instance be made static IP?

4

2 回答 2

2

不,你不能。据亚马逊称:

.. 一个实例只能有一个 Internet 可路由 IP 地址。如果弹性 IP 映射到实例,则其现有的公共 IP 地址映射将被删除。

http://aws.amazon.com/articles/1346

顺便说一句,在您的代码中硬编码 IP 是一个非常糟糕的主意。

于 2013-04-04T10:22:06.723 回答
0

What Brennan said is right you cant do it. Its a bad idea to hard code to ip address, what we do is we assign a domain or a subdomain or even hard code it some times. Though my IP address changes, I just to change my A record.

于 2013-04-04T11:34:34.533 回答