API Gateway set stage variable based on source IP Address

0

Would like to route API Gateway invocation based on source IP Address. Eg. is source IP 10.x.x.x then invoke function A, if source IP 11.y.y.y then invoke function B. Similar with what Route53 supports for routing based on IP Address but we don't have access to Route53. Thank you in advance, Lucian

2 Answers
2

API Gateway does not support content based routing. One option might be to invoke a Lambda function that will invoke the appropriate backend.

profile pictureAWS
EXPERT
Uri
answered a year ago
profile picture
EXPERT
iwasa
reviewed a year ago
1

A potential design could be that you create an API Gateway backed by a Step Function. (https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-api-gateway.html).

Then you could pass the IP or get it as part of header/payload (encrypted if you wish), passit to a Choice step that based on that decides which Step/Lambda function to call.

profile picture
EXPERT
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions