rdegges rdegges - 4 months ago 19x
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?


In the API Gateway, it's the value



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