Home > Software design >  Is there a way to assign one static elastic IP to multiple instances?
Is there a way to assign one static elastic IP to multiple instances?

Time:11-09

Is there anyway that many ec2 instances can share the same IP? So that all outbound API requests from the ec2 instances, are coming from the same IP address? If the API provider were to whitelist the single static IP address, it would grant access to all of the instances.

Any ideas would be great!

CodePudding user response:

If this is for outbound only, then it can be achieved using a NAT Gateway.

All the EC2 instances will sit behind the public NAT Gateway, the NAT Gateway is then assigned an Elastic IP Address.

All traffic from the EC2 instances will be routed via the NAT Gateway to the Internet Gateway and the target environment will see all the traffic originating from the Elastic Ip Address assigned to the NAT Gateway.

However, if traffic must go the other way (inbound), then this architecture will not work.

  • Related