Home > OS >  Calling REST API hosted on local-machine from AWS Lambda
Calling REST API hosted on local-machine from AWS Lambda

Time:11-10

I am having a use case where I need to invoke a Rest API which is deployed/running on my local-machine (locahost:8090) from an AWS Lambda Function which will get triggered on an SQS event.

I cannot go with API Gateway Option. I am able to invoke the same API using the IP address from POSTMAN, can I use some Rest Client Like HttpClient or RestTemplate to invoke the same API using the IP address.

Also do I need to have some policy attached to my Lambda function, as when I am calling using HttpClient my Lambda function timesout.

CodePudding user response:

It sounds like what you need is an internet facing proxy that can forward (tunnel) requests to your local machine. Products like ngrok or localxpose are designed to do this easily, giving you an auto-generated host name that is accessible from anywhere on the internet and will forward the http requests to a process running on your local machine.

There are also a number of open source projects with similar functionality, but you would have to host these yourself. Here is an example of an "awesome" repo listing quite a few open source options.

  • Related