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