I'm trying to do some vary basic routing with API Gateway. I need to achieve the following scenario:
user makes request xxxx-execute-api.eu-west-1.amazonaws.com/prod/api1/a/b/../n?param1=val1&parma2=val2...¶mn=valn request should go to api1.back.end/a/b/../n?param1=val1&parma2=val2...¶mn=valn
user makes request xxxx-execute-api.eu-west-1.amazonaws.com/prod/api2/a/b/../n?param1=val1&parma2=val2...¶mn=valn request should go to api2.back.end/a/b/../n?param1=val1&parma2=val2...¶mn=valn
user makes request xxxx-execute-api.eu-west-1.amazonaws.com/prod/*****/a/b/../n?param1=val1&parma2=val2...¶mn=valn request should go to api3.back.end/a/b/../n?param1=val1&parma2=val2...¶mn=valn
The routing should be done based on first path index after stage, and everything else after that should be passed to the http backend (like a transparent proxy).
In other words, if path index 1 is api1, forward request to api1.back.end with full URI after path index 1; if path index 1 is api2, forward request to api2.back.end with full URI after path index 1; if path index 1 is anything else than the explicit values api1 or api2, forward request to api3.back.end with full URI after path index 1;
How would I achieve this, without adding any extra layers (lambda, cloudfront, ec2, etc.) ?
Thank you!
API Gateway does not support this use case today; each method and path must be explicitly defined in your API definition.
Supporting such passthrough proxies is a request we have heard from other customers and we may consider supporting it in future updates to the service.
UPDATE 09/20/2016: I'm happy to announce that we've launched a set of features to allow for proxying of requests as described above. See our announcement for more details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With