Updating the Elastic IP address of a Network Load Balancer



I would like to replace the current Elastic IP address associated to my Network Load Balancer by an another Elastic IP address which is associated to an EC2 Instance (which will be terminated after the migration).

So I went to the Edit Subnet option, but it seems that I can't change the IPv4 address (Availability Zones is greyout). I have only one zone filled. But I can choose a new availability zone, and then select the Elastic IP Adress. But it means that I will two IP addresses attached to the NLB ?

I tried to disassociate the IP through the network interface page but I got the following error : "Failed to disassociate public IP address xx.xx.xxx.xxx from network interface eni-xxxxxxxxxxxxxx. API error: "You do not have permission to access the specified resource."

This error is probabily due to the fact the IP is currently in use. Is the only way to re create a netword load balancer ?

Any help would be appreciated :)

asked 3 years ago2342 views
3 Answers

You can reference this link on how to update the Elastic IP of a NLB: https://aws.amazon.com/premiumsupport/knowledge-center/elb-attach-elastic-ip-to-public-nlb/

answered a year ago

Hello MrJibus,

I want to directly address your question about replacing the ElasticIP that you configured for the NLB. Once an NLB is created with an ElasticIP you can always add another node with an additional EIP for the purpose of resilience across zones. As mentioned before, this is covered here: https://aws.amazon.com/premiumsupport/knowledge-center/elb-attach-elastic-ip-to-public-nlb/.

This does not cover the use case that you are describing which is to replace the IP of the an existing NLB node(s). Unfortunately, once an NLB node is created, you cannot alter the ElasticIP associated with it. This is documented here:

As quoted from the documentation here: https://docs.aws.amazon.com/elasticloadbalancing/latest/network/network-load-balancers.html:

"...When you create an internet-facing load balancer, you can optionally specify one Elastic IP address per subnet. If you do not choose one of your own Elastic IP addresses, Elastic Load Balancing provides one Elastic IP address per subnet for you. These Elastic IP addresses provide your load balancer with static IP addresses that will not change during the life of the load balancer. You can't change these Elastic IP addresses after you create the load balancer..."

As such, you are correct. You will have to create the NLB again, if you want to alter ANY existing Elastic IP assignment to ANY existing NLB nodes.

profile pictureAWS
answered 9 months 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