How IP addresses get logged when using Lambda and API Gateway

0

A customer is asking if IP addresses get logged when using Lambda and API Gateway? He mentioned that this is important for them to be GDPR compliant once the new regulation comes into force. Thank you!

已提问 6 年前4528 查看次数
1 回答
1
已接受的回答

You can enable Amazon CloudWatch Logs to trace API calls. Once enabled, API Gateway will log API calls in CloudWatch. The API gateway access log will have the information of the IP address "ip": "$context.identity.sourceIp":

https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-logging.html

Or check the value of "X-Forwarded-For" if you want to build a function in API Gateway by using Lambda Proxy integration:

https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html

审核人员
已回答 6 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则