I am creating a backend with ECS and I need to have a static IP, for what I understand from the AWS console all internet-facing load balancers are assigned an IP address by AWS, my question is: Will that IP address change? And if I have 2 Availability Zones, both have different IPs?
For internet-facing load balancers, the IPv4 addresses of the nodes are assigned by AWS.
For internal load balancers, the IPv4 addresses are assigned from the subnet CIDR.
CodePudding user response:
Will that IP address change? And if I have 2 Availability Zones, both have different IPs?
Yes, for application load balancer (ALB), the IPs are not static. If you want static IP for ALB you can add AWS Global Accelerator to it.
Alternatively, use network LB (NLB), which has static IP addresses.
CodePudding user response:
Yes, the IPs change sporadically and you're correct that the IP is different in each Availability Zone.
If you need to have static IPs, you could consider fronting an Application Load Balancer with a Network Load Balancer. This would allow an elastic IP to be set for each AZ that the NLB resides and you should still get the benefits of the ALB.
The downsides would be extra cost and latency. I haven't tried this myself so can't vouch for how well it works.