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
질문됨 2년 전5292회 조회
2개 답변
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
전문가
답변함 2년 전
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
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠