how to allocate elastic IP address to auto scaling group?

0

I have allocated an elastic IP address to the auto-scaling group. after traffic increases, it creates another instance with a new IP address. the newly generated IP address is not assigned automatically to the elastic IP address.

Arshad
gefragt vor 2 Jahren5310 Aufrufe
2 Antworten
1

You could use a Proxy or NAT-Gateway in front of the EC2 fleet that way regardless of the ASG activity externally NAT-Gateway EIP will be seen as the source IP.

profile pictureAWS
EXPERTE
beantwortet vor 2 Jahren
0

An EIP (or any public IP) can only be assigned to a single instance/ENI, you can't assign it to multiple instances as you scale. AutoScaling only supports a static EIP when the group has a max of 1 instance (in which case that EIP/ENI can be reused on replacement instance, but the group can't scale above 1 instance). What is your goal here?

A static inbound IP?

  • Use a Network Load Balancer (NLB) and attach its target group to the ASG. NLB IPs are static and never change with 1 EIP per AZ

Static outbound IP?

  • Use a NAT Gateway

Both?

  • You'll need to create a pool of unused EIPs, and then create a userdata script in the Launch Template for your AutoScaling Group. The script will need to search for available EIPs and attach one to the instance

Note that all 3 of the above options have varying levels of cost associated with them.

AWS
beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen