Session Boto 3 Docs 1.10.43 documentation

A session manages state about a particular configuration. By default a session is created for you when needed. However it is possible and recommended to maintain your own session(s) in some scenarios. Sessions typically store:

A session manages state about a particular configuration. By default a session is created for you when needed. However it is possible and recommended to maintain your own session(s) in some scenarios. Sessions typically store:

  • Credentials
  • Region
  • Other configurations

Default Session

The boto3 module acts as a proxy to the default session, which is created automatically when needed. Example default session use:

# Using the default session sqs = boto3.client('sqs') s3 = boto3.resource('s3') 

Custom Session

It is also possible to manage your own session and create clients or resources from it:

# Creating your own session session = boto3.session.Session() sqs = session.client('sqs') s3 = session.resource('s3') 

ncG1vNJzZmian6m8dHrAppizp56WxLR6wqikaK5hZLGwr9SmnKeskam2sLqOmqeiZ2FjfnF6k2xmoK2ZmbJwv8SsqqKnnmO1tbnL

 Share!