A function that, when invoked, returns a promise that will be fulfilled with a value of type T. It memoizes the result from the previous invocation instead of calling the underlying resources every time.

You can force the provider to refresh the memoized value by invoke the function with optional parameter hash with forceRefresh boolean key and value true.

Example

A function that reads credentials from IMDS service that could
return expired credentials. The SDK will keep using the expired credentials
until an unretryable service error requiring a force refresh of the
credentials.
interface MemoizedProvider<T> ((options?) => Promise<T>)

Type Parameters

  • T

  • Parameters

    • Optional options: {
          forceRefresh?: boolean;
      }
      • Optional forceRefresh?: boolean

    Returns Promise<T>