I have two services that handle a series of HTTP endpoints. Service1's endpoints all start with /someValue Service2's endpoints all start with /anotherValue
Each service is fronted by a different API Gateway. Additionally, those two services must be accessible using the same domain name. So the idea I have been experimenting with is to have: Route53 point the domain name to an ALB which in turn will direct the requests to the appropriate Target Group (by reading the start of the path) pointing to the correct API Gateway.
My problem is that I do not know how to create a Target Group that points to an API Gateway. The only options I see are:
What am I missing?
I tried pointing the target group to the "IP Addresses", hoping that I could provide the URL of my API Gateway APIs but that was not allowed.
The other options clearly are not what I need here.
Many of the other questions in Stack Overflow (and generally on the Internet) address having API Gateway in front of the Load Balancer; we need the ALB in front of the API Gateway.
There are two options I see:
Front the API Gateways with simple Lambda functions (that you can then point the ALB Target Groups to) Your system will then be Route53 -> ALB -> Lambda -> API Gateway -> :backing system: And the connection of ALB to Lambda is a straightforward one (it is one of the options that you listed in your question)
Remove the API Gateways altogether and directly point the ALB Target Groups to whatever sits behind the API Gateways (EC2 instances, Lambda functions, or FarGate containers) Your system will then be Route53 -> ALB -> :backing system: And your problem will be removed entirely