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年前4928ビュー
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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ