fix: support AWS GovCloud and China region ARNs in Bedrock validation #9482
+351
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
validateBedrockArnandparseArnfunctions to accept aws, aws-us-gov, and aws-cn partitionsChanges
webview-ui/src/utils/validate.tsto support aws-us-gov and aws-cn partitionssrc/api/providers/bedrock.tsparseArn method to support GovCloud and China regionsvalidateBedrockArn.spec.tswith tests for all partition typesbedrock.spec.tsfor GovCloud and China ARN parsingTesting
Example ARNs now supported
arn:aws-us-gov:bedrock:us-gov-west-1:123456789012:inference-profile/us-gov.anthropic.claude-sonnet-4-5-20250929-v1:0arn:aws-cn:bedrock:cn-north-1:123456789012:foundation-model/anthropic.claude-v2Fixes #9481