
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
aws-region-proximity
Advanced tools
Print a JSON dictionary where the key is an AWS region code name (us-west-2, eu-central-1, etc.), and the value is a list of regions in order of their physical proximity to the region. You may optionally pass in a list of region code names that you have a copy of the resource in. The results will have the same keys, but the lists will only contain the regions you specified.
Say you have S3 buckets being cross-region-replicated in us-west-2,
eu-central-1, and ap-southeast-1 and you want to put a Cloudfront
distribution in front of them. You can use a Lambda@Edge with an Origin Request
trigger to change the origin that Cloudfront will pull a resource from.
Lambda@Edge has the environment variable AWS_REGION, which will tell you the
closest region to where your Lambda is executing. You could then use the list
generated by this program to help find the nearest origin that can handle the
request.
For example, a request comes in to the DFW edge location. The environment
variable AWS_REGION is "us-east-1" (the AWS region associated with the edge
location of DFW). You don't have a copy of the resource in us-east-1, but
you do have a copy in us-west-2. So that can be the copy you return (as
opposed to your copy in eu-central-1 or ap-southeast-1).
pip install aws-region-proximity
aws-regions
{
"us-east-1": [
"us-east-1",
"us-east-2",
"ca-central-1",
"us-west-2",
"us-west-1",
"eu-west-1",
"eu-west-2",
"eu-west-3",
"eu-central-1",
"eu-north-1",
"eu-south-1",
"sa-east-1",
"ap-northeast-1",
"me-south-1",
"cn-north-1",
"ap-northeast-2",
"cn-northwest-1",
"af-south-1",
"ap-south-1",
"ap-east-1",
"ap-southeast-1",
"ap-southeast-2"
],
...
"cn-northwest-1": [
"cn-northwest-1",
"cn-north-1",
"ap-east-1",
"ap-northeast-2",
"ap-northeast-1",
"ap-south-1",
"ap-southeast-1",
"me-south-1",
"eu-north-1",
"eu-central-1",
"eu-south-1",
"eu-west-2",
"eu-west-3",
"eu-west-1",
"ap-southeast-2",
"us-west-2",
"us-west-1",
"ca-central-1",
"us-east-2",
"us-east-1",
"af-south-1",
"sa-east-1"
]
}
For when you have copies in a limited number of regions and just want to see your closest available region given some other region.
aws-regions us-west-2 eu-central-1 ap-southeast-1
{
"us-east-1": [
"us-west-2",
"eu-central-1",
"ap-southeast-1"
],
"us-east-2": [
"us-west-2",
"eu-central-1",
"ap-southeast-1"
],
"us-west-1": [
"us-west-2",
"eu-central-1",
"ap-southeast-1"
],
"us-west-2": [
"us-west-2",
"eu-central-1",
"ap-southeast-1"
],
"eu-west-1": [
"eu-central-1",
"us-west-2",
"ap-southeast-1"
],
...
"cn-north-1": [
"ap-southeast-1",
"eu-central-1",
"us-west-2"
],
"cn-northwest-1": [
"ap-southeast-1",
"eu-central-1",
"us-west-2"
]
}
There is still a key for every region, but the list of the closest regions is limited to those specified on the command line.
This Gist: https://gist.github.com/atyachin/a011edf76df66c5aa1eac0cdca412ea9
Instead of geographic coordinates, it'd probably be better if we sorted by actual inter-region latency, like what this table has: https://www.cloudping.co/grid
Put it on the TODO list.
FAQs
Generates a list of AWS regions closest to each other
We found that aws-region-proximity demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.