Get Client IP address

I’m trying to get the client ip address, I’ve tried using context.identity.sourceIp but this is not defined. Any idea how to get this?

1 Like

Hey @webchaz, you should be able to access it at event.requestContext.identity.sourceIp.

There’s an example API Gateway event object here.

Also, in the docs where you found the context documentation, that’s included in the event object in the requestContext key (as shown above) when using the default lambda-proxy event type.

2 Likes