Loading Credentials in Node.js using a Configured Credential Process - Amazon SDK for JavaScript
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

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

Loading Credentials in Node.js using a Configured Credential Process

You can source credentials by using a method that isn't built into the SDK. To do this, specify a credential process in the shared Amazon config file or the shared credentials file. If the AWS_SDK_LOAD_CONFIG environment variable is set to any value, the SDK will prefer the process specified in the config file over the process specified in the credentials file (if any).

For details about specifying a credential process in the shared Amazon config file or the shared credentials file, see the Amazon CLI Command Reference, specifically the information about Sourcing Credentials From External Processes.

For information about using the AWS_SDK_LOAD_CONFIG environment variable, see Using a Shared Config File in this document.