Core Interface#
This module provides the main interface for constructing refreshable boto3 sessions.
The RefreshableSession class serves as a factory that dynamically selects the appropriate
credential refresh strategy based on the method parameter, e.g., sts.
For additional information on required and optional parameters for each method, refer to the
refresh strategies documentation.
Users can interact with AWS services just like they would with a normal boto3.session.Session,
with the added benefit of automatic credential refreshing.
Examples#
>>> from boto3_refresh_session import AssumeRoleConfig, RefreshableSession
>>> session = RefreshableSession(
... assume_role_kwargs=AssumeRoleConfig(RoleArn="<your-role-arn>"),
... region_name="us-east-1"
... )
>>> s3 = session.client("s3")
>>> s3.list_buckets()
Factory#
Factory class for configuring boto3 sessions with various different automatic credential refresh methods. |