Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IP address location lookup using AWS Services

I have a Java application running on AWS instances, and which uses the AWS SDK for Java v1.12. I'd like to be able to lookup location information based on an IP address, such as city and state. Does AWS provide this service? If so, is there a basic Java example available somewhere?

like image 375
user2215659 Avatar asked Nov 21 '25 15:11

user2215659


1 Answers

While AWS does not offer it as a standalone service, if you only want to lookup the location of your calling clients, CloudFront CDN does offers extra headers you can use to achieve that.

For your use case you can have a look at:

  • CloudFront-Viewer-Country
  • CloudFront-Viewer-City
  • CloudFront-Viewer-Country-Region

ref: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-cloudfront-headers.html#cloudfront-headers-viewer-location

like image 63
Michael Avatar answered Nov 24 '25 03:11

Michael



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!