Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Nov 21, 2025

Description

This PR attempts to address Issue #9481 by adding support for AWS GovCloud and China region ARNs in the Bedrock validation logic. Feedback and guidance are welcome.

Problem

The ARN validation regex was too strict and only accepted standard AWS partition ARNs (arn:aws:...) but rejected valid GovCloud (arn:aws-us-gov:...) and China region (arn:aws-cn:...) ARNs.

Solution

  • Updated the ARN validation regex in both validateBedrockArn and parseArn functions to accept aws, aws-us-gov, and aws-cn partitions
  • Added comprehensive test coverage for GovCloud and China region ARNs

Changes

  • Updated ARN regex in webview-ui/src/utils/validate.ts to support aws-us-gov and aws-cn partitions
  • Updated ARN regex in src/api/providers/bedrock.ts parseArn method to support GovCloud and China regions
  • Added new test file validateBedrockArn.spec.ts with tests for all partition types
  • Added tests in bedrock.spec.ts for GovCloud and China ARN parsing

Testing

  • ✅ All new tests for GovCloud and China ARN validation pass
  • ✅ All existing Bedrock provider tests pass
  • ✅ Type checking passes
  • ✅ Linting passes

Example ARNs now supported

  • GovCloud: arn:aws-us-gov:bedrock:us-gov-west-1:123456789012:inference-profile/us-gov.anthropic.claude-sonnet-4-5-20250929-v1:0
  • China: arn:aws-cn:bedrock:cn-north-1:123456789012:foundation-model/anthropic.claude-v2

Fixes #9481

- Updated ARN regex in validateBedrockArn to support aws-us-gov and aws-cn partitions
- Updated ARN regex in bedrock.ts parseArn method to support GovCloud and China regions
- Added comprehensive tests for GovCloud and China ARN validation
- Fixes #9481
@roomote roomote bot requested review from cte, jr and mrubens as code owners November 21, 2025 18:24
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Nov 21, 2025
@roomote
Copy link
Contributor Author

roomote bot commented Nov 21, 2025

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found.

The implementation correctly adds support for AWS GovCloud (aws-us-gov) and China (aws-cn) region ARNs. The changes are minimal, well-tested, and backwards compatible.

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Nov 21, 2025
@wisestmumbler
Copy link

Any updates for this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[BUG] Custom ARN Regex for AWS Bedrock is too strict

4 participants