1 Answer
- Newest
- Most votes
- Most comments
1
It depends on which API you are using. If you are using HTTP API, the source IP is at event.requestContext.http.sourceIP
or event.headers.x-forwarded-for. If you are using REST API it will be in event.headers.X-Forwarded-For
or event.requestContext.identity.sourceIp
. You are trying to access event.identity.sourceIP
.
Note, in both cases you do not need a mapping template, just return a body from the Lambda function. If you are using REST API, you may be able to implement it using a Mock integration and a mapping template, although I did not test it.
understood. Thank you!
Relevant content
- asked a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 years ago
Can you log the "event" parameter? I think you should use "event.sourceIP"