rdegges rdegges - 2 years ago 159
Node.js Question

How can I retrieve a user's public IP address via Amazon API Gateway + Lambda (node)

I'm currently writing a Node.js lambda function, in which I want to log the incoming requester's public IP address. I've been looking through both the API Gateway and Lambda docs all day, but haven't found a solution.

Does the lambda

object include request metadata I can use to extract the user's IP?

Answer Source

In the API Gateway, it's the value



You can pass that through to your Lambda via a mapping template.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download