Skip to content

Commit e53d299

Browse files
authored
Allow Amazon Bedrock Marketplace ARNs (#2874)
* Update validate.ts Allow ARNs from Bedrock Marketplace, which are different because models are deployed using SageMaker Inference behind the scenes. * Update bedrock.ts Allow ARNs from Bedrock Marketplace, which are different because models are deployed using SageMaker Inference behind the scenes.
1 parent 844753e commit e53d299

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/api/providers/bedrock.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
532532
* match[4] - The resource ID (e.g., "anthropic.claude-3-sonnet-20240229-v1:0")
533533
*/
534534

535-
const arnRegex = /^arn:aws:bedrock:([^:]+):([^:]*):(?:([^\/]+)\/([\w\.\-:]+)|([^\/]+))$/
535+
const arnRegex = /^arn:aws:(?:bedrock|sagemaker):([^:]+):([^:]*):(?:([^\/]+)\/([\w\.\-:]+)|([^\/]+))$/
536536
let match = arn.match(arnRegex)
537537

538538
if (match && match[1] && match[3] && match[4]) {

webview-ui/src/utils/validate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export function validateApiConfiguration(apiConfiguration?: ApiConfiguration): s
8989
*/
9090
export function validateBedrockArn(arn: string, region?: string) {
9191
// Validate ARN format
92-
const arnRegex = /^arn:aws:bedrock:([^:]+):([^:]*):(?:([^/]+)\/([\w.\-:]+)|([^/]+))$/
92+
const arnRegex = /^arn:aws:(?:bedrock|sagemaker):([^:]+):([^:]*):(?:([^/]+)\/([\w.\-:]+)|([^/]+))$/
9393
const match = arn.match(arnRegex)
9494

9595
if (!match) {

0 commit comments

Comments
 (0)