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개 답변
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
전문가
Uri
답변함 일 년 전
profile picture
전문가
iwasa
검토됨 일 년 전
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
전문가
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인