How to Create Refreshable Boto3 Session

Ritul Patel
1 min readAug 2, 2020

--

Purpose of this post is to show how to leverage botocore library to create refreshable boto3 session.

There are many good reason to use refreshable boto3 session. One common scenario is that in order to reduce https latency when creating boto3 connections, people might cache client or resource object. But if we don’t use refreshable boto3 session, we might run into issue where credentials might have expired and then any boto3 call will fail with expired token error.

Here’s how you can do that:

Enjoy Coding!!!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Ritul Patel
Ritul Patel

Written by Ritul Patel

Software Engineer with passion to learn new tech!

No responses yet

Write a response