Session Boto 3 Docs 1.9.46 documentation
Publish date: 2024-04-28
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')
ncG1vNJzZmian6m8dHrAppizp56WxLR6wqikaK5hZLGwr9SmnKeskam2sLqOmqeiZ2Fjhm%2BAlWierqGUmny0sdKsoKimXp3Brrg%3D