Skip to content

Add VPC endpoint support to BedrockModel class - Add optional endpoin… #502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dbavro19
Copy link

@dbavro19 dbavro19 commented Jul 20, 2025

Description

Adds support for custom endpoint URLs in the BedrockModel class to enable connectivity through AWS VPC endpoints (PrivateLink). This feature allows users to specify a custom endpoint URL for organizations that require all Bedrock traffic to flow through VPC endpoints for security and compliance reasons.

Changes Made:

  • Add optional endpoint_url parameter to BedrockModel constructor
  • Pass endpoint_url to boto3 client for VPC endpoint connectivity
  • Update BedrockConfig TypedDict to include endpoint_url field
  • Update constructor docstring to document VPC endpoint usage
  • Maintains backward compatibility with existing code

Usage Example:

from strands.models import BedrockModel

# Using VPC endpoint
model = BedrockModel(
    model_id="us.anthropic.claude-sonnet-4-20250514-v1:0",
    endpoint_url="https://vpce-1234567-abcd.bedrock-runtime.us-west-2.vpce.amazonaws.com",
    region_name="us-west-2"
)

Related Issues

Resolves: Issue #496

Documentation PR

Type of Change

New feature

Testing

How have you tested the change?

  • Verified backward compatibility - existing code continues to work unchanged
  • Tested VPC endpoint parameter acceptance and storage in config
  • Confirmed endpoint_url is properly passed to boto3 client
  • Validated BedrockConfig TypedDict includes new parameter
  • I ran hatch run prepare

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 (docstring updates)
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • 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.

…t_url parameter to BedrockModel constructor - Pass endpoint_url to boto3 client for VPC endpoint connectivity - Maintains backward compatibility with existing code Resolves: Issue strands-agents#496
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant