I would like to proxy the incoming requests to different endpoints based on a request header received in the request.
In AWS API gateway, I can set up different endpoints as separate stage variables but at integration >> Endpoint URL setting, I would like to pick the stage variable based on the value of request header value.
For example:
if header value is brand-id: abc then request should be proxied to abc.test.com
if header value is brand-id: pqr then request should be proxied to pqr.test.com
I'm expecting something like this in "Endpoint URL" value: http://${stageVariables.${method.request.header.brand-id}}/
Any help to achieve this would be appreciated.