Cache credentials across all clients #4612
Labels
feature-request
New feature or enhancement. May require GitHub community feedback.
p2
This is a standard priority issue
queued
This issues is on the AWS team's backlog
Describe the feature
In sdk v3 CredentialProviders are not internally cached1. Each time you call a credential provider it refreshes credentials from it's source. This causes workflows that use multiple aws services to take longer as each client fetches the same credentials from the source.
Each client caches credentials by wrapping the provider in memoize, but memoize does not cache across instances.
Credential providers should use a cache shared across all clients.
Use Case
The use case is any workflow that involves creating multiple aws-sdk clients that use the same credentials or identity. This workflow should only fetch credentials once, not once per client.
Proposed Solution
A couple options:
Option 1 works with aws-sdk authored credential providers as well as user defined providers.
Option 2 would only work out of the box with aws authored providers
Option 3 would only work when users read the docs
Other Information
No response
Acknowledgements
SDK version used
~3.300
Environment details (OS name and version, etc.)
All
Footnotes
except the default node provider chain ↩
The text was updated successfully, but these errors were encountered: