Skip to content

Creating a lookup table #49

@cetanu

Description

@cetanu

Hey there,

Some background...
A while ago I created a lookup table manually using the data from the cloudping website.

The lookup table is used to determine which region is nearest to a particular region.

The table looks like this:

 ap-southeast-2:
    ap-southeast-2: '0'
    us-west-2: '1'
    us-west-1: '2'
    ap-southeast-1: '3'
    us-east-1: '4'
    us-east-2: '5'
    eu-west-1: '6'
    eu-west-2: '7'
    eu-central-1: '8'
ap-southeast-1:
    ap-southeast-1: '0'
    us-west-2: '1'
    eu-central-1: '2'
    eu-west-2: '3'
    us-west-1: '4'
    eu-west-1: '5'
    ap-southeast-2: '6'
    us-east-1: '7'
    us-east-2: '8'
eu-central-1:
    eu-central-1: '0'
    eu-west-2: '1'
    eu-west-1: '2'
    us-east-1: '3'
    us-east-2: '4'
    us-west-1: '5'
    us-west-2: '6'
    ap-southeast-2: '7'
    ap-southeast-1: '8'
    # and so on... and so forth...

and is used, in python for example, like this:

priority = table[source_region][destination_region]

I started out with only a few regions, but now I need to do many more. This is pretty tedious to do by hand.

I was about to build something that would scrape the website and calculate this data instead, however, I thought I'd bring this forward as an issue to see if:

  1. There is an easier way to do this that is closer to the data, and doesn't require html scraping
  2. This would be useful for anyone else

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions