How to use the @aws-sdk/credential-provider-process.fromProcess function in @aws-sdk/credential-provider-process

To help you get started, we’ve selected a few @aws-sdk/credential-provider-process examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws / aws-sdk-js-v3 / packages / credential-provider-node / src / index.ts View on Github external
export function defaultProvider(
  init: FromIniInit & RemoteProviderInit & FromProcessInit = {}
): CredentialProvider {
  const { profile = process.env[ENV_PROFILE] } = init;
  const providerChain = profile
    ? fromIni(init)
    : chain(fromEnv(), fromIni(init), fromProcess(init), remoteProvider(init));

  return memoize(
    providerChain,
    credentials =>
      credentials.expiration !== undefined &&
      credentials.expiration - getEpochTs() < 300,
    credentials => credentials.expiration !== undefined
  );
}

@aws-sdk/credential-provider-process

AWS credential provider that sources credential_process from ~/.aws/credentials and ~/.aws/config

Apache-2.0
Latest version published 2 days ago

Package Health Score

98 / 100
Full package analysis

Popular @aws-sdk/credential-provider-process functions