think I have a very unusual request. We want to use a AWS network loadbalancer to send traffic to 2 endpoints in a NONE AWS environment. So the endpoints are not in an AWS VPC. Requirment is that calls to the 2 endpoints must be round robin. Both endpoints are HTTP POST endpoints and they have a different hostname but the URL prefix is the same. Something like this. Endpoint 1 = http://www.example1.com/test/uri and Endpoint 2 = http://www.example2.com/test/uri . I am struggling in the AWS console and tried things with the AWS network loadbalancer and create a targetgroup and a api gateway with a http API and a Rest API but I can't get it working.
I think it is not possible to achieve such a configuration in AWS, but maybe somebody has an idea how to solve this ?
You can't do this directly. It is explained in AWS docs:
You can't specify publicly routable IP addresses.
You would have to setup VPN or some other type of proxy on AWS rough your connections to these the public endpoints.