code: function isEndpointDiscoveryApplicable(request) {
    var service = request.service || {};
    if (service.config.endpointDiscoveryEnabled === true) return true;
  
    //shared ini file is only available in Node
    //not to check env in browser
    if (util.isBrowser()) return false;
  
    for (var i = 0; i < endpointDiscoveryEnabledEnvs.length; i++) {
      var env = endpointDiscoveryEnabledEnvs[i];
      if (Object.prototype.hasOwnProperty.call(process.env, env)) {
        if (process.env[env] === '' || process.env[env] === undefined) {
          throw util.error(new Error(), {
            code: 'ConfigurationException',
            message: 'environmental variable ' + env + ' cannot be set to nothing'
          });
        }
        if (!isFalsy(process.env[env])) return true;
      }
    }
  
    var configFile = {};
    try {
      configFile = AWS.util.iniLoader ? AWS.util.iniLoader.loadFrom({
        isConfig: true,
        filename: process.env[AWS.util.sharedConfigFileEnv]
      }) : {};
    } catch (e) {}
    var sharedFileConfig = configFile[
      process.env.AWS_PROFILE || AWS.util.defaultProfile
    ] || {};
    if (Object.prototype.hasOwnProperty.call(sharedFileConfig, 'endpoint_discovery_enabled')) {
      if (sharedFileConfig.endpoint_discovery_enabled === undefined) {
        throw util.error(new Error(), {
          code: 'ConfigurationException',
          message: 'config file entry \'endpoint_discovery_enabled\' cannot be set to nothing'
        });
      }
      if (!isFalsy(sharedFileConfig.endpoint_discovery_enabled)) return true;
    }
    return false;
  }
docs: If endpoint discovery should perform for this request when endpoint discovery is optional.
  SDK performs config resolution in order like below:
  1. If turned on client configuration(default to off) then turn on endpoint discovery.
  2. If turned on in env AWS_ENABLE_ENDPOINT_DISCOVERY then turn on endpoint discovery.
  3. If turned on in shared ini config file with key 'endpoint_discovery_enabled', then
  turn on endpoint discovery.
  @param [object] request request object.
  @api private