aws_list_all icon indicating copy to clipboard operation
aws_list_all copied to clipboard

S3 Service Fails and Unable to Retrieve region agnostic services like Route53

Open StoreBot opened this issue 4 years ago • 1 comments

No response for s3, route53 etc.

StoreBot avatar Jun 11 '20 17:06 StoreBot

def get_regions_for_service(requested_service, requested_regions=()):
    """Given a service name, return a list of region names where this service can have resources,
    restricted by a possible set of regions."""
    if requested_service in ('iam', 'cloudfront', 's3', 'route53'):
       # instead of None use the default region so it will also work for gov-cloud.
        return [boto3.session.Session().region_name if boto3.session.Session().region_name else 'us-east-1']
    regions = set(get_service_regions().get(requested_service, []))
    return list(regions) if not requested_regions else list(sorted(set(regions) & set(requested_regions)))

ghost avatar Jun 11 '20 18:06 ghost

This problem is fixed in v0.9. by a new heuristic.

JohannesEbke avatar Nov 14 '22 18:11 JohannesEbke