@@ -360,78 +360,49 @@ export const BEDROCK_MAX_TOKENS = 4096
360360
361361export const BEDROCK_DEFAULT_CONTEXT = 128_000
362362
363- export const BEDROCK_REGION_INFO : Record <
364- string ,
365- {
366- regionId : string
367- description : string
368- pattern ?: string
369- multiRegion ?: boolean
370- }
371- > = {
372- /*
373- * This JSON generated by AWS's AI assistant - Amazon Q on March 29, 2025
374- *
375- * - Africa (Cape Town) region does not appear to support Amazon Bedrock at this time.
376- * - Some Asia Pacific regions, such as Asia Pacific (Hong Kong) and Asia Pacific (Jakarta), are not listed among the supported regions for Bedrock services.
377- * - Middle East regions, including Middle East (Bahrain) and Middle East (UAE), are not mentioned in the list of supported regions for Bedrock. [3]
378- * - China regions (Beijing and Ningxia) are not listed as supported for Amazon Bedrock.
379- * - Some newer or specialized AWS regions may not have Bedrock support yet.
380- */
381- "us." : { regionId : "us-east-1" , description : "US East (N. Virginia)" , pattern : "us-" , multiRegion : true } ,
382- "use." : { regionId : "us-east-1" , description : "US East (N. Virginia)" } ,
383- "use1." : { regionId : "us-east-1" , description : "US East (N. Virginia)" } ,
384- "use2." : { regionId : "us-east-2" , description : "US East (Ohio)" } ,
385- "usw." : { regionId : "us-west-2" , description : "US West (Oregon)" } ,
386- "usw2." : { regionId : "us-west-2" , description : "US West (Oregon)" } ,
387- "ug." : {
388- regionId : "us-gov-west-1" ,
389- description : "AWS GovCloud (US-West)" ,
390- pattern : "us-gov-" ,
391- multiRegion : true ,
392- } ,
393- "uge1." : { regionId : "us-gov-east-1" , description : "AWS GovCloud (US-East)" } ,
394- "ugw1." : { regionId : "us-gov-west-1" , description : "AWS GovCloud (US-West)" } ,
395- "eu." : { regionId : "eu-west-1" , description : "Europe (Ireland)" , pattern : "eu-" , multiRegion : true } ,
396- "euw1." : { regionId : "eu-west-1" , description : "Europe (Ireland)" } ,
397- "euw2." : { regionId : "eu-west-2" , description : "Europe (London)" } ,
398- "euw3." : { regionId : "eu-west-3" , description : "Europe (Paris)" } ,
399- "euc1." : { regionId : "eu-central-1" , description : "Europe (Frankfurt)" } ,
400- "euc2." : { regionId : "eu-central-2" , description : "Europe (Zurich)" } ,
401- "eun1." : { regionId : "eu-north-1" , description : "Europe (Stockholm)" } ,
402- "eus1." : { regionId : "eu-south-1" , description : "Europe (Milan)" } ,
403- "eus2." : { regionId : "eu-south-2" , description : "Europe (Spain)" } ,
404- "ap." : {
405- regionId : "ap-southeast-1" ,
406- description : "Asia Pacific (Singapore)" ,
407- pattern : "ap-" ,
408- multiRegion : true ,
409- } ,
410- "ape1." : { regionId : "ap-east-1" , description : "Asia Pacific (Hong Kong)" } ,
411- "apne1." : { regionId : "ap-northeast-1" , description : "Asia Pacific (Tokyo)" } ,
412- "apne2." : { regionId : "ap-northeast-2" , description : "Asia Pacific (Seoul)" } ,
413- "apne3." : { regionId : "ap-northeast-3" , description : "Asia Pacific (Osaka)" } ,
414- "aps1." : { regionId : "ap-south-1" , description : "Asia Pacific (Mumbai)" } ,
415- "aps2." : { regionId : "ap-south-2" , description : "Asia Pacific (Hyderabad)" } ,
416- "apse1." : { regionId : "ap-southeast-1" , description : "Asia Pacific (Singapore)" } ,
417- "apse2." : { regionId : "ap-southeast-2" , description : "Asia Pacific (Sydney)" } ,
418- "ca." : { regionId : "ca-central-1" , description : "Canada (Central)" , pattern : "ca-" , multiRegion : true } ,
419- "cac1." : { regionId : "ca-central-1" , description : "Canada (Central)" } ,
420- "sa." : { regionId : "sa-east-1" , description : "South America (São Paulo)" , pattern : "sa-" , multiRegion : true } ,
421- "sae1." : { regionId : "sa-east-1" , description : "South America (São Paulo)" } ,
363+ // AWS Bedrock Inference Profile mapping based on official documentation
364+ // https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-support.html
365+ // This mapping is pre-ordered by pattern length (descending) to ensure more specific patterns match first
366+ export const AWS_INFERENCE_PROFILE_MAPPING : Array < [ string , string ] > = [
367+ // US Government Cloud → ug. inference profile (most specific prefix first)
368+ [ "us-gov-" , "ug." ] ,
369+ // Americas regions → us. inference profile
370+ [ "us-" , "us." ] ,
371+ // Europe regions → eu. inference profile
372+ [ "eu-" , "eu." ] ,
373+ // Asia Pacific regions → apac. inference profile
374+ [ "ap-" , "apac." ] ,
375+ // Canada regions → ca. inference profile
376+ [ "ca-" , "ca." ] ,
377+ // South America regions → sa. inference profile
378+ [ "sa-" , "sa." ] ,
379+ ]
422380
423- // These are not official - they weren't generated by Amazon Q nor were
424- // found in the AWS documentation but another Roo contributor found apac.
425- // Was needed so I've added the pattern of the other geo zones.
426- "apac." : { regionId : "ap-southeast-1" , description : "Default APAC region" , pattern : "ap-" , multiRegion : true } ,
427- "emea." : { regionId : "eu-west-1" , description : "Default EMEA region" , pattern : "eu-" , multiRegion : true } ,
428- "amer." : { regionId : "us-east-1" , description : "Default Americas region" , pattern : "us-" , multiRegion : true } ,
429- }
430-
431- export const BEDROCK_REGIONS = Object . values ( BEDROCK_REGION_INFO )
432- // Extract all region IDs
433- . map ( ( info ) => ( { value : info . regionId , label : info . regionId } ) )
434- // Filter to unique region IDs (remove duplicates)
435- . filter ( ( region , index , self ) => index === self . findIndex ( ( r ) => r . value === region . value ) )
436- // Sort alphabetically by region ID
437- . sort ( ( a , b ) => a . value . localeCompare ( b . value ) )
381+ // AWS Bedrock supported regions for the regions dropdown
382+ // Based on official AWS documentation
383+ export const BEDROCK_REGIONS = [
384+ { value : "us-east-1" , label : "us-east-1" } ,
385+ { value : "us-east-2" , label : "us-east-2" } ,
386+ { value : "us-west-1" , label : "us-west-1" } ,
387+ { value : "us-west-2" , label : "us-west-2" } ,
388+ { value : "ap-northeast-1" , label : "ap-northeast-1" } ,
389+ { value : "ap-northeast-2" , label : "ap-northeast-2" } ,
390+ { value : "ap-northeast-3" , label : "ap-northeast-3" } ,
391+ { value : "ap-south-1" , label : "ap-south-1" } ,
392+ { value : "ap-south-2" , label : "ap-south-2" } ,
393+ { value : "ap-southeast-1" , label : "ap-southeast-1" } ,
394+ { value : "ap-southeast-2" , label : "ap-southeast-2" } ,
395+ { value : "ap-east-1" , label : "ap-east-1" } ,
396+ { value : "eu-central-1" , label : "eu-central-1" } ,
397+ { value : "eu-central-2" , label : "eu-central-2" } ,
398+ { value : "eu-west-1" , label : "eu-west-1" } ,
399+ { value : "eu-west-2" , label : "eu-west-2" } ,
400+ { value : "eu-west-3" , label : "eu-west-3" } ,
401+ { value : "eu-north-1" , label : "eu-north-1" } ,
402+ { value : "eu-south-1" , label : "eu-south-1" } ,
403+ { value : "eu-south-2" , label : "eu-south-2" } ,
404+ { value : "ca-central-1" , label : "ca-central-1" } ,
405+ { value : "sa-east-1" , label : "sa-east-1" } ,
406+ { value : "us-gov-east-1" , label : "us-gov-east-1" } ,
407+ { value : "us-gov-west-1" , label : "us-gov-west-1" } ,
408+ ] . sort ( ( a , b ) => a . value . localeCompare ( b . value ) )
0 commit comments