Skip to content

fix(amazon-bedrock): extract region from inference profile ARNs#5527

Merged
badlogic merged 1 commit into
earendil-works:mainfrom
AJM10565:fix/bedrock-arn-region-parsing
Jun 9, 2026
Merged

fix(amazon-bedrock): extract region from inference profile ARNs#5527
badlogic merged 1 commit into
earendil-works:mainfrom
AJM10565:fix/bedrock-arn-region-parsing

Conversation

@AJM10565

@AJM10565 AJM10565 commented Jun 8, 2026

Copy link
Copy Markdown

Application inference profile ARNs encode the region
(arn:aws:bedrock:<region>:<account>:...) but the provider ignored it,
falling through to AWS_REGION which may point to a different region.
Extract the region from the ARN when present, taking priority over
environment variables.

This is the solution proposed in #4860 (option 1: parse region from ARN).

Problem: In enterprise environments, AWS_REGION is commonly set to
one region (e.g. us-east-1) for general AWS CLI operations, while
Bedrock inference profiles live in a different region (e.g. us-west-2).
The provider used AWS_REGION for the Bedrock API call, causing
ValidationException: The provided model identifier is invalid.

Fix: Add an ARN check as the first step in region resolution. If the
model ID matches arn:aws:bedrock:<region>:..., use that region. Otherwise
fall through to existing behavior (env vars, endpoint, defaults).

Fixes #4860

Application inference profile ARNs encode the region
(arn:aws:bedrock:<region>:<account>:...) but the provider ignored it,
falling through to AWS_REGION which may point to a different region.
Extract the region from the ARN when present, taking priority over
environment variables.

Fixes earendil-works#4860
@badlogic badlogic merged commit 44e3379 into earendil-works:main Jun 9, 2026
2 checks passed
@badlogic

badlogic commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

cheers

alnaggar-dev added a commit to alnaggar-dev/pi that referenced this pull request Jun 10, 2026
…region-parsing

fix(amazon-bedrock): extract region from inference profile ARNs

(cherry picked from commit 44e3379)
Fork-Flow-Port: 44e3379
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Bedrock region configuration independent of AWS_REGION

2 participants