Skip to content

feat(session): add endpoint_url parameter to S3SessionManager#2061

Open
Zelys-DFKH wants to merge 1 commit intostrands-agents:mainfrom
Zelys-DFKH:feat/s3-session-manager-endpoint-url
Open

feat(session): add endpoint_url parameter to S3SessionManager#2061
Zelys-DFKH wants to merge 1 commit intostrands-agents:mainfrom
Zelys-DFKH:feat/s3-session-manager-endpoint-url

Conversation

@Zelys-DFKH
Copy link
Copy Markdown

Description

`S3SessionManager` creates its boto3 S3 client without accepting an `endpoint_url` parameter. This makes it impossible to use the session manager with S3-compatible storage backends such as MinIO or LocalStack, which are common in local development and VPC endpoint configurations.

`BedrockModel` already accepts `endpoint_url` as a first-class constructor parameter and forwards it to its boto3 client. This change applies the same pattern to `S3SessionManager`.

Changes:

  • Add `endpoint_url: str | None = None` to `S3SessionManager.init()`
  • Forward it to `session.client(service_name="s3", ...)`
# Local development with MinIO
session_manager = S3SessionManager(
    session_id="dev-session",
    bucket="dev-bucket",
    endpoint_url="http://localhost:9000",
)

# VPC endpoint / PrivateLink
session_manager = S3SessionManager(
    session_id="prod-session",
    bucket="prod-bucket",
    endpoint_url="https://bucket.vpce-abc123.s3.us-east-1.vpce.amazonaws.com",
)

When `endpoint_url` is not provided (the default), behavior is unchanged.

Related Issues

Fixes #1794

Documentation PR

N/A

Type of Change

New feature

Testing

  • Added `test_init_s3_session_manager_with_endpoint_url` verifying that `endpoint_url` is forwarded to the boto3 client creation call
  • All 47 existing S3SessionManager tests pass

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Forwards an optional endpoint_url to the boto3 S3 client, enabling use
with S3-compatible backends such as MinIO or LocalStack. Follows the same
pattern as BedrockModel, which already accepts endpoint_url as a
constructor parameter.

Closes strands-agents#1794
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add endpoint_url parameter to S3SessionManager for S3-compatible storage backends

1 participant