We announced the upcoming end-of-support for AWS SDK for JavaScript v2.
We recommend that you migrate to AWS SDK for JavaScript v3. For dates, additional details, and information on how to migrate, please refer to the linked announcement.

Class: AWS.IniLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/shared-ini/ini-loader.js

Overview

Note:

This feature is not supported in the browser environment of the SDK.

Ini file loader class the same as that used in the SDK. It loads and parses config and credentials files in .ini format and cache the content to assure files are only read once. Note that calling operations on the instance instantiated from this class won't affect the behavior of SDK since SDK uses an internal singleton of this class.

Constructor Summary collapse

Method Summary collapse

Constructor Details

new AWS.IniLoader() ⇒ void

Method Details

clearCachedFiles() ⇒ void

Remove all cached files. Used after config files are updated.

loadFrom(options) ⇒ map<String,String>

Load configurations from config/credentials files and cache them for later use. If no file is specified it will try to load default files.

Parameters:

  • options (map)

    information describing the file

Options Hash (options):

  • filename (String) — default: '~/.aws/credentials' or defined by AWS_SHARED_CREDENTIALS_FILE process env var or '~/.aws/config' if isConfig is set to true

    path to the file to be read.

  • isConfig (Boolean) — default: false

    True to read config file.

Returns:

  • (map<String,String>)

    object containing contents from file in key-value pairs.

loadSsoSessionsFrom(options) ⇒ map<String,String>

Load sso sessions from config/credentials files and cache them for later use. If no file is specified it will try to load default file.

Parameters:

  • options (map)

    information describing the file

Options Hash (options):

  • filename (String) — default: '~/.aws/config' or defined by AWS_CONFIG_FILE process env var

Returns:

  • (map<String,String>)

    object containing contents from file in key-value pairs.