Search code examples
amazon-web-servicesnetworkingdevopsamazon-ecsamazon-alb

How do I configure AWS Application load balancer and NAT gateway to have the public IP


so currently in our infrastructure we are using ECS with an application load balancer for inbound traffic and a NAT gateway for outbound traffic. I am looking to configure both inbound and outbound traffic to have the same public IP address but I am not sure how this is done as I've tried may different ways to achieve this but nothing seemed to have worked. If we take a look at the below image our infrastructure is similar except that we us EC2 and not fargate as we prefer to maintain our own instances

Screen shot

I would be very thankful if anyone could please help me out with this


Solution

  • I don’t think this is possible. External traffic is always routed though a NAT gateway, and incoming either though unknown number of ever changing load balancers or directly to IP of the e.g. EC2 instance.