1

I'm looking after solution where AWS Api Gateway changes method endpoint Url dynamically. I am familiar with stage variables and in Integration request I can change endpoint per method like (https://${stageVariables.Url}/api/DoSomething). What I need is that information how parse endpoint is included in requests. https://${RequestData.Url}/api/DoSomething I have same Api in different locations and to implement centralized Api keys and logging services I try to forward all traffic through this one Api Gateway. After first request client gets its endpoint information, but I don't know how to solve that clients next requests to Gateway should forward to that endpoint which client get earlier.

2 Answers 2

0

I got an answer from AWS support. They told that I have to make a lambda function to process all requests or just use Stage variables.

Sign up to request clarification or add additional context in comments.

2 Comments

do you have any reference link or can you elaborate your answer?
I developed system where I have multiple stages with their own endpoint URL in stage variable. Client gets stage name as an first response and when following requests are made to that stage it will be forwarded to another backend. Another way around, clients have to be able to parse their requests to include stagename. ie. calls will be like api.testi.com/parsed_stagename/something/GET, This way I don't need lambda function in middle to processs and forward requests by header.
0

You can use a second API Gateway (Other API) that responde diferent for each ${RequestData.Url}.

This looks like:

  • secondapigateway/bla001
  • secondapigateway/bla002
  • secondapigateway/bla003

Where bla001 ... are path parameters passed by first API Gateway.

For this, create an resource /{proxy+} for any http method. In Intregration Request put https://secondapigateway/{RequestData.Url}/{proxy}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.