8000 Adding support for custom VPC endpoints when using AWS Bedrock models by kcwhite · Pull Request #3947 · RooCodeInc/Roo-Code · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Adding support for custom VPC endpoints when using AWS Bedrock models #3947

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 25 commits into
base: main
Choose a base branch
from

Conversation

kcwhite
Copy link
@kcwhite kcwhite commented May 25, 2025

Related GitHub Issue

Closes: #3492

Description

This PR adds support for custom VPC endpoints when using AWS Bedrock models. This feature is particularly important for corporate customers who need to keep all LLM transactions secure inside their firewall.

Implementation details:

  • Added a new configuration option in the Bedrock provider settings to specify a custom endpoint URL
  • Updated the AWS Bedrock client initialization to use the custom endpoint when provided
  • Maintained backward compatibility for users who don't specify a custom endpoint
  • Added appropriate validation for the endpoint URL format

Test Procedure

  1. Unit Tests: Added tests for the Bedrock provider with custom endpoints

    • Tests verify that the client is properly configured with the custom endpoint
    • Tests confirm backward compatibility when no endpoint is specified
  2. Manual Testing:

    • Configure Roo Code with AWS Bedrock provider
    • Add a custom VPC endpoint URL in the settings
    • Verify that requests are routed through the specified endpoint
    • Verify that error handling works correctly for invalid endpoints
    • Verify text box disappears when "Use custom VPC endpoint" checkbox is unchecked
    • Verify that requests fail when "Use custom VPC endpoint" option is disabled and other settings are unchanged
    • Verify that the previous custom VPC endpoint URL populates the text box when re-enabling the option
    • Verify that requests succeed after re-enabling the option
  3. Verification:

    • All tests pass as confirmed by running pnpm test
    • The feature has been tested with actual AWS VPC endpoints in a corporate environment

Type of Change

  • 🐛 Bug Fix: Non-breaking change that fixes an issue.
  • New Feature: Non-breaking change that adds functionality.
  • 💥 Breaking Change: Fix or feature that would cause existing functionality to not work as expected.
  • ♻️ Refactor: Code change that neither fixes a bug nor adds a feature.
  • 💅 Style: Changes that do not affect the meaning of the code (white-space, formatting, etc.).
  • 📚 Documentation: Updates to documentation files.
  • ⚙️ Build/CI: Changes to the build process or CI configuration.
  • 🧹 Chore: Other changes that don't modify src or test files.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Code Quality:
    • My code adheres to the project's style guidelines.
    • There are no new linting errors or warnings (npm run lint).
    • All debug code (e.g., console.log) has been removed.
  • Testing:
    • New and/or updated tests have been added to cover my changes.
    • All tests pass locally (npm test).
    • The application builds successfully with my changes.
  • Branch Hygiene: My branch is up-to-date (rebased) with the main branch.
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Changeset: A changeset has been created using npm run changeset if this PR includes user-facing changes or dependency updates.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

I have included 2 screenshots

Documentation Updates

  • Yes, documentation updates are required. The AWS Bedrock provider documentation should be updated to include information about the new custom VPC endpoint option, including format requirements and use cases.

Additional Notes

This feature has been requested by several enterprise customers who need to use Roo Code with their secure AWS environments. It enables them to comply with their internal security policies while still leveraging the power of AWS Bedrock models through Roo Code.

Get in Touch

Discord: chuck_33620

670103AE-C745-4A5D-9930-8DEA5294D00E
6AECC094-75B8-49D0-89FA-780E35E91909


Important

Adds support for custom VPC endpoints in AWS Bedrock models with UI and backend changes, ensuring backward compatibility and comprehensive test coverage.

  • Behavior:
    • Adds support for custom VPC endpoints in AWS Bedrock models via awsBedrockEndpoint and awsBedrockEndpointEnabled in ProviderSettings.
    • Updates AwsBedrockHandler in bedrock.ts to use custom endpoint if enabled.
    • Maintains backward compatibility if no custom endpoint is specified.
  • UI:
    • Adds checkbox and text field for VPC endpoint configuration in Bedrock.tsx.
    • Updates UI state based on awsBedrockEndpointEnabled.
  • Tests:
    • Adds unit tests in bedrock-vpc-endpoint.test.ts to validate endpoint configuration logic.
    • Adds UI tests in Bedrock.test.tsx to verify checkbox and text field behavior.
  • Types:
    • Updates ProviderSettings in roo-code.d.ts and types.ts to include new fields for VPC endpoint configuration.

This description was created by Ellipsis for 617e68e. You can customize this summary. It will automatically update as commits are pushed.

Kevin White and others added 23 commits May 11, 2025 03:11
- Changed checkbox label to 'Use custom VPC endpoint' to match Cline

- Fixed conditional rendering to show text field when checkbox is checked

- Ensured placeholder text appears correctly

- Maintained proper styling for consistency
- Added state variable to track checkbox selection

- Fixed conditional rendering to show/hide text field based on checkbox state

- Maintained proper styling and placeholder text
…ling

- Fixed checkbox onChange handler to accept boolean directly instead of event object

- Added unit tests to verify the behavior

- Maintained proper styling and placeholder text
- Removed left margin from text field to align with checkbox

- Maintained proper styling and placeholder text
- Added awsBedrockEndpointEnabled field to schema

- Modified Bedrock provider to check both endpoint URL and enabled flag

- Updated UI to preserve endpoint URL when checkbox is toggled

- Maintained proper alignment with checkbox
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label May 27, 2025
@hannesrudolph hannesrudolph moved this from Triage to Needs Preliminary Review in Roo Code Roadmap May 27, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels May 27, 2025
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label May 30, 2025
@daniel-lxs
Copy link
Collaborator

Hey @kcwhite this looks good to me, could you solve the merge conflicts to hopefully get this merged?

Thank you!

@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Changes Requested] in Roo Code Roadmap May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR - Changes Requested PR - Needs Preliminary Review size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
Status: PR [Changes Requested]
Development

Successfully merging this pull request may close these issues.

Add AWS Bedrock Custom VPC Endpoint Support
3 participants
0