0

I have an AWS infrastructure as follow:

  • EC2-WS01
  • EC2-WS02
  • Load balancer

These machines run the same code. In front of these machines is there a Load Balancer that distribute the load. So the clients point to the load balancer that forward the requests. One of the services of my app is a webhook service that send to an external server, protected by a firewall, some information every 15 minutes. We had to setup the firewall accepting the request from the two EC2 IP Address. I want to know if is possible make sure that regardless of the instances I have, when I make a request, it is always made by the same ip

Is possible to do that with an Elastic IP or what else?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
whiteproud
  • 95
  • 2
  • 9
  • I cannot understand your question because the keywords you used are mixed up and do not describe your situation accurately. – Gapton Jan 08 '21 at 08:32
  • Omk I try to explain better. – whiteproud Jan 09 '21 at 18:40
  • NAT. Add a NAT with an Elastic IP (EIP) and route your web server outbound requests through the NAT. Whitelist the EIP on the remote server. – jarmod Jan 09 '21 at 19:51

1 Answers1

1

Your architecture would need to be:

  • Load Balancer in a public subnet
  • Amazon EC2 instances in private subnet(s)
  • A NAT Gateway or NAT Instance in a public subnet, with an Elastic IP address
  • A Route Table on the private subnet(s) that sends Internet-bound traffic via the NAT Gateway/NAT Instance

The traffic from the Amazon EC2 instances will "come from" the public Elastic IP address associated with the NAT Gateway/NAT Instance.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470