Skip to content

AWS resource's region lookup by its public IPv4 or IPv6 address

License

Notifications You must be signed in to change notification settings

krystianhub/AWS-Region-Finder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS Region Finder

What is it

AWS resource's region lookup by its public IPv4 or IPv6 address.

How does it work

The service is using the following AWS API call behind the scenes to retrieve the latest CIDR database of all AWS services.

How to use it

You just need to pass "ip" parameter of the AWS IP address you are looking for.

In response you will get a set of matches (if it is a valid AWS IP address), including its CIDR group, region, and service associated with it.

Additionally, there is a field called "requested_ip" which is simply echoing the IP address you are trying to look up.

"cache_status" reports its status about cached CIDR datastore. Values can be either "LOCAL" (meaning it is stored in RAM memory), or a value of "cf-cache-status" header (you can read more about Cloudflare's "CF-Cache-Status" mechanics).

Web UI

Web UI is available here

Screenshot of the Web UI's example results

cURL example

curl "https://aws-wasm.home-cloud.workers.dev/?ip=52.1.1.1"
{
  "requested_ip": "52.1.1.1",
  "cache_status": "LOCAL",
  "matches": [
    {
      "ip_prefix": "52.0.0.0/15",
      "region": "us-east-1",
      "service": "AMAZON",
      "network_border_group": "us-east-1"
    },
    {
      "ip_prefix": "52.0.0.0/15",
      "region": "us-east-1",
      "service": "EC2",
      "network_border_group": "us-east-1"
    }
  ]
}

API service was built on Cloudflare Workers serverless platform