Boto3: Add human readable Name for region in describe_regions() or equivalent api call

Created on 9 Jan 2018  路  3Comments  路  Source: boto/boto3

  • Description

i would like to have a Api call for a Mapping of the Region Names used in the aws console to the region id (e.g: the describe_region() region_name return value)
this could either be part of the describe_region or as a seperate api call.

  • Versions:

    • Python: 3.6.4 64 bit

    • Boto3: 1.5.10

  • current behaviour:
    describe_regions returns region id (e.g us-east-1) and endpoint

  • wanted behaviour:
    Api call returns region id , end point and the Name you also see in the aws console

feature-request

Most helpful comment

Any progress on this? I'm currently using the Pricing API in Boto3, and when using a filter for the get_products method, the location field requires the region description e.g. "EU (Ireland)" instead of the region code (eu-west-1). Though a more appropriate fix would be to have the Pricing API support codes.

All 3 comments

Makes sense. We have the metadata available stored in the botocore's endpoints.json to implement it as well. Marking as a feature request.

I was looking for the same thing.

The information I was looking for is exactly what the botocore file endpoints.json has. It would be appropriate to list the endpoints by service in a call as describe_endpoints() or similar, and add the field region.description to the call describe_regions().

Until then, this is a possible temporary solution:

from pkg_resources import resource_filename
endpoint_file= resource_filename('botocore', 'data/endpoints.json')

with open(endpoint_file, 'r') as f:
    return json.load(f)

Any progress on this? I'm currently using the Pricing API in Boto3, and when using a filter for the get_products method, the location field requires the region description e.g. "EU (Ireland)" instead of the region code (eu-west-1). Though a more appropriate fix would be to have the Pricing API support codes.

Was this page helpful?
0 / 5 - 0 ratings