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 Risposte
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
ESPERTO
Uri
con risposta un anno fa
profile picture
ESPERTO
iwasa
verificato un anno fa
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
ESPERTO
con risposta un anno fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande