Normally S3 objects in localstack can be accessed via `http://localhost:4572/bucket/key`.

However, if the object is 7 MBs or larger, attempting to access it via this URL will result in a 403 error. Objects any smaller are retrieved as expected.

(Possibly related: Lambda response size is limited to 6MB. Perhaps that is being used by accident?)
return get_local_region()
def get_local_region():
    global LOCAL_REGION
    if LOCAL_REGION is None:
        session = boto3.session.Session()
        LOCAL_REGION = session.region_name or ''
    return LOCAL_REGION or config.DEFAULT_REGION
def get_local_service_url(service_name_or_port):
    """ Return the local service URL for the given service name or port. """
    if isinstance(service_name_or_port, int):
        return '%s://%s:%s' % (get_service_protocol(), LOCALHOST, service_name_or_port)
    service_name = service_name_or_port
    if service_name == 's3api':
        service_name = 's3'
    return os.environ['TEST_%s_URL' % (service_name.upper().replace('-', '_'))]
def is_service_enabled(service_name):
    """ Return whether the service with the given name (e.g., "lambda") is available. """
    try:
        url = get_local_service_url(service_name)
        assert url
        return is_port_open(url, http_path='/', expect_success=False)
    except Exception:
        return False
def connect_to_service(service_name, client=True, env=None, region_name=None, endpoint_url=None, config=None):