What are the guarantees of custom and automatic primary private IPv4 address assignments in EC2?

0

I am trying to understand guarantees and potential conflicts of declaring a custom primary private IPv4 as outlined here: https://aws.amazon.com/premiumsupport/knowledge-center/custom-private-primary-address-ec2/

...

Suppose I have an EC2 instance (call it instance 'A'), for which I declared a custom primary private IPv4 address at launch time.

Suppose I have another EC2 instance (call it instance 'B'), in the same subnet as instance A, for which I did not declare a custom primary private IPv4 address, and is automatically assigned an IP at startup.

  1. Is there a guarantee that 'A' will ALWAYS be assigned the custom private private IPv4 address declared, even when stopped and restarted?

  2. Is there a guarantee that 'B' will NEVER be assigned the custom primary private IPv4 address of instance A, even if instance A is stopped?

1 Answer
0

Hello, thank you for your post. The following is noted in our documentation on EC2 Instance IP Addressing[1]:

"A private IPv4 address, regardless of whether it is a primary or secondary address, remains associated with the network interface when the instance is stopped and started, or hibernated and started, and is released when the instance is terminated."

With this in mind, you can be certain that even if your EC2 instance is stopped or restarted, the primary private IPv4 address will remain associated with it, and the IP address will never be assigned to a different instance. After the EC2 instance is terminated, its primary private IP address will be released, at which point it could potentially be automatically assigned to a newly launched instance.

References:
[1] https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html

AWS
SUPPORT ENGINEER
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions