AWS Credentials Cache Upgrade Guide #923
Replies: 1 comment 11 replies
-
@jdisanti I'm trying to upgrade my code and running into issues, although maybe an edge case. I have code that does custom request signing (specifically to make Prometheus remote write requests to AMP). I used to have code that looked roughly like this:
And then I could do something like:
Which was quite simple. Now it looks like all of this has been removed and the caching code is intertwined with the smithy runtime. I can kind of see how to manually build a lazy cache manually, but then to use it I have to start providing RuntimeComponents and various other things, which makes me think I'm not doing what I'm supposed to be doing. Is there some better way of doing this in the new world? Thanks. |
Beta Was this translation helpful? Give feedback.
-
This guide explains the changes to AWS credentials caching in the AWS Rust SDK.
Previously, the
ConfigLoader
,SdkConfig
, andConfig
all had acredentials_cache()
method that would take configuration for caching. For example:In the near future, the SDK will support both AWS credentials and SSO tokens. In addition, the underlying code generator, smithy-rs, needed a cache for its supported identity types such as HTTP auth, bearer auth, etc. To address this, a single unified identity cache was added to replace the credentials cache.
Using the identity cache is similar to the credentials cache. The example above can be done with the following:
Additionally, the default lazy caching implementation can still be customized. For example, the load timeout can be tweaked:
Beta Was this translation helpful? Give feedback.
All reactions