I have a weird scenario where I need to route certain outbound traffic from an app hosted on EC2 through different regional IP addresses.
Long story short we have 2 clients with APIs that our app communicates with to POST data. We found that their firewalls are strict at times and eventually block us mostly because we are in a different country. After a lot of back and forth, I eventually cloned our EC2 instance in their region with an IP in their country and the problem went away instantly.
Since this test was successful we figured we could just use the main EC2 instance and use routing rules that detect data header/url and route the outbound traffic through a different internet gateway for these 2 clients.
What's the best way to achieve this in AWS?