Skip to content

AWS Analytics & Location Tracking

0

I have an application running on ASP.NET hosted on an EC2 machine. Is there a way to track/log user location based on his IP? Which service might assist? AWS analytics?

1 Answer
1
Accepted Answer

Hello Mohamad,

In my opinion, the most straightforward way to log user IP locations is by leveraging Amazon CloudFront. You will have to set up CloudFront as your CDN infront of your EC2 application, this would allow user request to route through the CloudFront domain instead of directly to your EC2 instance. CloudFront will be handling the logging of user's IP without adding any extra load to your EC2 instances.

To start logging your user request on CloudFront you will have to:

  1. Enable logging on CloudFront
  2. Link an S3 bucket where you want the logs to be stored.

After you have these set up CloudFront will automatically log user requests which includes the user's IP and the location of the CloudFront edge server that handles the request. Once the logs are stored in your s3 bucket, you can use Amazon Athena to query and analyze the data(if needed).

If you think my response answers your question please select this as accepted answer cheers!

AWS
answered a year ago
EXPERT
reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.