It looks like a duplicate of old issue https://github.com/localstack/localstack/issues/78
But now it's reproducible for me with the latest version of LocalStack. 
global SERVICE_PORTS, CONFIG_ENV_VARS
    SERVICE_PORTS = service_ports or parse_service_ports()
    globs = globals()
    
    for key, value in six.iteritems(DEFAULT_SERVICE_PORTS):
        key_upper = key.upper().replace('-', '_')
        
        port_var_name = 'PORT_%s' % key_upper
        port_number = service_port(key)
        globs[port_var_name] = port_number
        url = 'http%s://%s:%s' % ('s' if USE_SSL else '', LOCALSTACK_HOSTNAME, port_number)
        
        url_key = 'TEST_%s_URL' % key_upper
        globs[url_key] = url
        
        os.environ[url_key] = url
    
    os.environ['LOCALSTACK_HOSTNAME'] = LOCALSTACK_HOSTNAME
    
    CONFIG_ENV_VARS += ['LOCALSTACK_' + v for v in CONFIG_ENV_VARS if not v.startswith('LOCALSTACK_')]
    CONFIG_ENV_VARS = list(set(CONFIG_ENV_VARS))
def service_port(service_key):