Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "sibling" zones #7

Open
bra-fsn opened this issue Sep 21, 2021 · 1 comment
Open

Support "sibling" zones #7

bra-fsn opened this issue Sep 21, 2021 · 1 comment

Comments

@bra-fsn
Copy link
Owner

bra-fsn commented Sep 21, 2021

Until a while I tried to add Wavelength and Local Zones to the mapping, like these:

    'US East (Verizon) - Washington DC': 'us-east-1-wl1-was1',
    'US West (Denver)': 'us-west-2-den-1',
    'US West (Los Angeles)': 'us-west-2-lax-1',
    'US West (Verizon) - Denver': 'us-west-2-wl1-den1',

but Amazon has ceased to provide this information in an easily accessible manner (from their pricing web page), so I'm dropping to support these.
Sometime in the future, if the mapping can be discovered by AWS APIs these could be added back.

@bra-fsn
Copy link
Owner Author

bra-fsn commented Oct 6, 2021

Amazon recommends the following workaround until the data is available via the APIs:

As a short-term mitigation I would recommend to use the Region and RegionMetadata infrastructure from the SDKv2, see

https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/regions/Region.html
https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/regions/RegionMetadata.html
https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/regions/RegionMetadataProvider.html

The long region names are tracked as description in RegionMetadata classes. This can be used to build a reverse mapping from those descriptions (for instance Asia Pacific(Sydney)) to the region code (for example ap-southeast-2) using RegionMetadataProvider:

fun regionLongMapMapping(): Map<String, String> {
    val metadataProvider = GeneratedRegionMetadataProvider()
    return Region.regions()
        .mapNotNull { metadataProvider.regionMetadata(it) }
        .map { it.description() to it.id() }
        .toMap()
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant