Support aws_session_token for S3 backends - #2462
Merged
Merged
Conversation
samzhang996-hue
pushed a commit
to samzhang996-hue/SimpleTuner
that referenced
this pull request
Apr 27, 2026
Support aws_session_token for S3 backends
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds support for AWS session tokens throughout the S3 data backend, ensuring compatibility with temporary AWS credentials (such as those used with IAM roles or STS). The changes update the configuration, backend initialization, and S3 connection logic to accept and use an
aws_session_tokenparameter.Key changes include:
AWS session token support in configuration:
aws_session_tokenas an optional field toImageBackendConfigand included it in serialization and deserialization logic insimpletuner/helpers/data_backend/config/image.py. [1] [2] [3]aws_session_tokenin the passthrough keys forTextEmbedConfiginsimpletuner/helpers/data_backend/config/text_embed.py.Backend and connection logic updates:
S3DataBackendand its builder to accept and propagate theaws_session_tokenparameter, ensuring it is passed to the underlying boto3 S3 client insimpletuner/helpers/data_backend/aws.pyandsimpletuner/helpers/data_backend/builders/aws.py. [1] [2] [3] [4] [5]aws_session_tokenfor authentication insimpletuner/helpers/data_backend/aws.py. [1] [2]