IP allocation from a given range for Application Load Balancer

0

I have an Application Load Balancer that adds instances dynamically based on the current load. To comply with a payment gateway's requirement for IP address, I need to assign a fixed IP address from a specified range of IPs to each instance. Is it possible to configure this setup such that the IP allocation from the range happens automatically when a new instance is added to the target group, and the IP is released when an instance is removed?

  • Are you referring to the private ip rage?

asked a year ago319 views
2 Answers
1

It's not clear from your question where the static IP is required.

For connections that are established inbound to the ALB (and from there to the target group) the IP address(es) of the instances in the target group aren't of concern to the source - because they are connecting to the ALB IP address (more on that in a moment). So you can absolutely have the instances in a private subnet; scale up and down; and the client is not aware of those IP addresses changing.

The challenge is that the ALB IP address may change. The ALB itself may scale up and down; or AWS might replace the ALB (to perform software upgrades; the underlying hardware might become unhealthy; etc.) and in those cases a new IP address will be allocated. The solution here is to use NLB instead where the IP addresses are always static - once created, the IP addresses will not change.

For connections that are established outbound from the instances to an external host the best way to have those connections appear to come from a predetermined IP address is to use a NAT Gateway. It has a static IP address; and all the instances in the private subnet can use it to communicate to the internet. Again, as the target group scales up and down all of the instances can use the NAT Gateway and the public IP address (where the traffic appears to come from) of that does not change.

profile pictureAWS
EXPERT
answered a year ago
0

Yes, it is possible to configure your setup such that the IP allocation from a specified range happens automatically when a new instance is added to the target group and the IP is released when an instance is removed. This can be achieved by using Elastic IP addresses (EIPs) in conjunction with the Application Load Balancer (ALB).

answered a year 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