Skip to content

Possibility to reduce the number of IMDSv2 token calls? #627

Answered by jdisanti
stefansundin asked this question in Q&A
Discussion options

You must be logged in to vote

I think the reason it's not caching is because each individual IMDS Client maintains its own token cache. You can construct the IMDS client once, and then pass it into the ImdsRegionProvider and ImdsCredentialsProvider builders.

Note: the aws-config defaults already use IMDS to retrieve region and credentials, so this extra configuration code isn't necessary unless you're trying to prohibit other methods of discovering them.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@stefansundin
Comment options

@jdisanti
Comment options

@stefansundin
Comment options

Answer selected by stefansundin
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