Using static IP address with Amazon EC2 - updated

2019-07-27 02:35发布

I've been following the following thread - unfortunately this question is almost 6 years old, and I'm curious of this advice has changed.

Using static IP address with Amazon EC2

From my understanding, if I have an EC2 Instance setup (in the case InA1 on IP address 11.22.33.44), then the IP address is associated with myaccount for a fixed period of time? If for whatever reason InA1 reboots, or looses it IP address, then have I lost that IP forever?

How long do I have if that IP address is associated with my account before that IP Is released back into "the public pool".

1条回答
时光不老,我们不散
2楼-- · 2019-07-27 03:18

The solution still is an Elastic IP address.

When you create an EC2 instance, and if it is assigned a public IP address, that public IP address will stay yours until the EC2 instance is stopped. At that point, the IP address is lost forever. There is no time limit.

If you require a constant, public IP address, the solution is (and always was) an Elastic IP address. Assign the Elastic IP address and it will remain in your AWS account until you release it back to AWS. Again, there is no time limit.

The only difference with Elastic IP address that has changed over time is whether it stays attached to your EC2 instance if you stop the EC2 instance:

  • If your EC2 instance is in a VPC, then the Elastic IP address remains attached to your instance.
  • If your EC2 instance is not in a VPC (ie. in EC2-Classic), then the Elastic IP address is detached from your instance when the instance is stopped, but it still remains in your account. When you restart your EC2 instance, reattach the Elastic IP address.
查看更多
登录 后发表回答