-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix: support AWS GovCloud and China region ARNs in Bedrock provider #10157
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
Conversation
Review complete. No issues found. The latest change simplifies the ARN regex to accept any partition ( Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
|
@roomote can you just allow anything for the partition in that regex? We don't actually capture it, right? |
Simplified the ARN regex to accept any partition (using |
Review complete. No issues found. The changes correctly update the ARN regex from explicitly matching Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
Related GitHub Issue
Addresses: #9481
Description
This PR attempts to address Issue #9481 by fixing the backend ARN validation in
src/api/providers/bedrock.tsto support AWS GovCloud (aws-us-gov) and AWS China (aws-cn) region ARNs.While PR #10110 fixed the webview validation, there was still a strict regex in the backend
parseArn()method that only acceptedarn:aws:prefix. This fix updates the regex to also accept:arn:aws-us-gov:(AWS GovCloud)arn:aws-cn:(AWS China)Changes
Updated the ARN regex in
parseArn()from:/^arn:aws:(?:bedrock|sagemaker):...$/to:
/^arn:(?:aws|aws-us-gov|aws-cn):(?:bedrock|sagemaker):...$/Added comprehensive tests for:
Test Procedure
cd src && npx vitest run api/providers/__tests__/bedrock.spec.tsAll 54 tests pass, including 6 new tests for GovCloud/China ARN support.
Pre-Submission Checklist
Documentation Updates
Additional Notes
Feedback and guidance are welcome.
Important
Updates
parseArn()inbedrock.tsto support AWS GovCloud and China ARNs, with tests added for validation.parseArn()inbedrock.tsto supportarn:aws-us-gov:andarn:aws-cn:.bedrock.spec.tsfor AWS GovCloud and China ARN parsing.bedrock.tsto reflect new ARN regex behavior.This description was created by
for d61e4b1. You can customize this summary. It will automatically update as commits are pushed.