1 個回答
- 最新
- 最多得票
- 最多評論
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!
相關內容
- AWS 官方已更新 1 年前
- AWS 官方已更新 2 年前
Can you log the "event" parameter? I think you should use "event.sourceIP"