My AWS EC2 instances has been assigned IP addresses. Since I want to change machine type because of underutilization, I have to stop them and lose my assigned addresses. Is there any way how to reserve IP addresses I am currently running these instances with? Thanks.
2 Answers
If you stop the instance its IP will change. If you want a static public IP you can assign an Elastic IP address to your instance, if you want a static private IP you can launch your instance inside a VPC. So, if you haven't already applied one of these solutions, there's no way to preserve its current IP.
-
1"if you haven't already applied one of these solutions, there's no way to preserve its current IP "I am afraid this answers my question, thanks.– wtdmnCommented Nov 20, 2021 at 20:05
IPv6 addresses assigned to EC2 instances, unlike v4, persist though stopping the instance. For either address family, terminating an instance will release the IP.
Elastic IP is an IPv4 only object that reserves an IP address.
Also consider putting the instances behind a load balancer. A stable service name can be helpful.