Improve documentation around client/credential caching #2775
Labels
documentation
This is a problem with documentation.
feature-request
A feature should be added or improved.
p3
This is a minor priority issue
queued
This issues is on the AWS team's backlog
Describe the issue
In https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/sessions.html, the guidance for caching
s3.Session
was clear:In https://aws.github.io/aws-sdk-go-v2/docs/migrating/ and https://aws.github.io/aws-sdk-go-v2/docs/making-requests/, I'm not clear on what could be cached. We have a long-lived application that might make hundreds of S3 calls over time, and we want to avoid hitting STS limits. If I understand correctly:
In this example:
1.
config.LoadDefaultConfig
: I think this might make a HTTP request to the instance metadata or STS endpoint if no static credentials are configured.2.
s3.Client
: This creates a new S3 client and loads the credentials from the config.Is it okay to cache
s3.Client
indefinitely? I presume that when the credentials are expired, it will automatically refresh them.It should also be okay to cache
config.LoadDefaultConfig
to avoid making an HTTP call, but it might just be easier to caches3.Client
.It'd be nice to update the documentation, especially in the migration guide, about this behavior.
Links
AWS Go SDK V2 Module Versions Used
The text was updated successfully, but these errors were encountered: