Skip to content

How long is the validity period of the aws session created? #4564

Answered by RanVaknin
zhlc2008 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @zhlc2008,

If you are referring to the Session object, it does not expire on its own, because it's just a configuration object and does not hold any kind of connection state that can time out. In v2 the name is changed to Config.

The validity of the session is tied to the validity of the credentials it wraps. If you are using an environment variable with hardcoded credentials it will never expire. If you are using an IAM role, the SDK will make calls to STS "under the hood" to retrieve temporary credentials, and those credentials will have an expiration associated with them. When they expire, the SDK will automatically make another call to STS to refresh those credentials.

So if config…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by RanVaknin
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants