anomalyco / anomalyco/opencode

Amazon Bedrock Nova models always route to ap-northeast-1, ignoring inference profiles and region config

Open
#41,009 1 comment 0 reactions 1 assignee View on GitHub

@nexxeln is already working on this.

Since Aug 7, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

When using Amazon Nova models (Nova Pro, Nova Lite, Nova Micro) through Amazon Bedrock in OpenCode, the Bedrock provider always routes invocations to ap-northeast-1 region, even when:

  • The user configures region: "ap-southeast-2" in opencode.json
  • The user specifies an APAC inference profile (e.g., apac.amazon.nova-pro-v1:0)
  • The user's AWS profile has SCP restrictions blocking ap-northeast-1

This causes authorization failures for users with Service Control Policies that restrict Bedrock access to specific regions due to data residency requirements.

Steps to Reproduce

Plugins

No response

OpenCode version

VS code extension v1.17.20

Steps to reproduce
  1. Configure OpenCode to use Amazon Bedrock with region ap-southeast-2:
{
  "provider": {
    "amazon-bedrock": {
      "options": {
        "region": "ap-southeast-2",
        "profile": "Any_bedrock_access_role"
      }
    }
  }
}
  1. Try to use any Nova model:

    • amazon.nova-pro-v1:0
    • apac.amazon.nova-pro-v1:0 (APAC inference profile)
    • amazon.nova-micro-v1:0
  2. Observe the error - it always shows routing to ap-northeast-1:

Forbidden: {"Message":"User: arn:aws:sts::<Acct_ID>:assumed-role/OrganizationAccountAccessRole/aws-sdk-js-178xxxxxxx921 is not authorized to perform: bedrock:InvokeModelWithResponseStream on resource: arn:aws:bedrock:ap-northeast-1::foundation-model/amazon.nova-pro-v1:0 with an explicit deny in a service control policy: arn:aws:organizations::<Acct_ID>:policy/o-egsxxxxjm/service_control_policy/p-mvuhvwxb"}
  1. Notice the error resource shows ap-northeast-1 despite configuration being ap-southeast-2.
Screenshot and/or share link

Direct CLI test shows model works in ap-southeast-2:

$ aws bedrock-runtime converse --region ap-southeast-2 --profile Any_bedrock_access_role --model-id amazon.nova-pro-v1:0 --messages '[{"role": "user", "content": [{"text": "Hello"}]}]'

# SUCCESS - Model is available and works in Sydney
APAC inference profile works via CLI:
$ aws bedrock-runtime converse --region ap-southeast-2 --profile Any_bedrock_access_role --model-id apac.amazon.nova-pro-v1:0 --messages '[{"role": "user", "content": [{"text": "Hello"}]}]'

# SUCCESS - APAC profile routes through Sydney

The only workaround is to use Anthropic and GLM models with AU inference profiles, which OpenCode handles correctly

Operating System

No response

Terminal

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.