0

I have an API Gateway and several Lambdas. I have an app that calls the API Gateway through a Proxy and sends the name of the resource it should call in the header on the request. Is there a way the API Gateway can figure which lambda to call ? Basically retrieve the name of the resource from the header and forward the request to the right endpoint accordingly ?

Thanks

1 Answer 1

1

It seems you're looking for header-based routing. Unfortunately, at the moment AWS API gateway is not supporting that.

I think for solving this, you can use a proxy lambda right after your api-gateway. That lambda can decide your routing since headers are accessible as an event parameter within the lambda function.

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

2 Comments

Okay, so this lambda would call all the others depending on the header. But should I have an SQS or something between this lamnda and the other ones ?
@Lina, You can directly invoke lambda from another lambda. You can refer this example medium.com/tech-carnot/…

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.