Skip to content

AWS Bedrock

Avant calls sts:AssumeRoleWithWebIdentity with the workspace’s assertion, then signs Bedrock requests with the temporary credentials. Avant never gets an access key, and usage is billed to your AWS account. Read How provider setup works first.

  1. An IAM OIDC provider for https://identity.avant.codes with client id sts.amazonaws.com. Create it once per account.
  2. An IAM role that trusts that provider only when aud = sts.amazonaws.com and sub is the workspace’s exact subject.
  3. A policy on the role that allows bedrock:InvokeModel, bedrock:InvokeModelWithResponseStream and bedrock:ListFoundationModels.

The role ARN is predictable (arn:aws:iam::<account-id>:role/avant-byoc), so you can create the workspace first, then the role.

Terminal window
ACCOUNT_ID="$(aws sts get-caller-identity --query Account --output text)"
BINDING_SUBJECT="avant:binding:..."
aws iam create-open-id-connect-provider \
--url https://identity.avant.codes --client-id-list sts.amazonaws.com
cat > avant-trust.json <<EOF
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": { "Federated": "arn:aws:iam::${ACCOUNT_ID}:oidc-provider/identity.avant.codes" },
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": { "StringEquals": {
"identity.avant.codes:aud": "sts.amazonaws.com",
"identity.avant.codes:sub": "${BINDING_SUBJECT}"
} }
}]
}
EOF
aws iam create-role --role-name avant-byoc --assume-role-policy-document file://avant-trust.json
aws iam put-role-policy --role-name avant-byoc --policy-name avant-bedrock --policy-document '{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": ["bedrock:InvokeModel", "bedrock:InvokeModelWithResponseStream", "bedrock:ListFoundationModels"],
"Resource": "*"
}]
}'

Skip create-open-id-connect-provider if the account already has it. For another workspace in the same account, create another role, or add a second subject to the trust condition.

Field Value
AWS region The Bedrock endpoint region, such as us-east-1 or eu-west-1
IAM role ARN arn:aws:iam::<account-id>:role/avant-byoc

Enter the role ARN, not the OIDC provider ARN.

Terminal window
avant workspace create --name bedrock --mode byoc-bedrock \
--region us-east-1 --role-arn arn:aws:iam::123456789012:role/avant-byoc
avant workspace verify bedrock

Verify assumes the role and calls ListFoundationModels.

Enable access to each model in Bedrock → Model access for the region.

Most models are called through cross-region inference profiles. The policy’s Inference location picks the profile:

  • United States or Europe uses the us. or eu. profile.
  • Global uses the global. profile, which runs anywhere and is usually cheaper. You must choose it explicitly.
  • With no inference location set, the workspace’s region decides.

Some models have no profile in every geography. DeepSeek is in-region only, so it works only when the workspace’s region is one where AWS serves it.

ModelAPILocationsHarnesses
claude-sonnet-5MessagesAnyClaude Code, OpenCode, Pi, Oh My Pi
claude-opus-5MessagesAnyClaude Code, OpenCode, Pi, Oh My Pi
claude-opus-5-5MessagesAnyClaude Code, OpenCode, Pi, Oh My Pi
claude-sonnet-5-5 (default)Messagesus, eu, globalClaude Code, OpenCode, Pi, Oh My Pi
claude-haiku-5-5Messagesus, eu, globalClaude Code, OpenCode, Pi, Oh My Pi
claude-fable-5-1Messagesus, globalClaude Code, OpenCode, Pi, Oh My Pi
claude-fable-5-2Messagesus, globalClaude Code, OpenCode, Pi, Oh My Pi
grok-4.7Chat Completions, Responsesus, globalCodex, OpenCode, Pi, Oh My Pi
gpt-5.6-terraChat Completions, Responsesus, globalCodex, OpenCode, Pi, Oh My Pi
gpt-5.6-lunaChat Completions, Responsesus, globalCodex, OpenCode, Pi, Oh My Pi
gpt-6-astraChat Completions, Responsesus, globalCodex, OpenCode, Pi, Oh My Pi
gpt-6-solChat Completions, Responsesus, globalCodex, OpenCode, Pi, Oh My Pi
gpt-6.1-solChat Completions, Responsesus, globalCodex, OpenCode, Pi, Oh My Pi
gpt-6.1-terraChat Completions, Responsesus, globalCodex, OpenCode, Pi, Oh My Pi
gpt-6.2-astraChat Completions, Responsesus, globalCodex, OpenCode, Pi, Oh My Pi
gpt-6.2-solChat Completions, Responsesus, globalCodex, OpenCode, Pi, Oh My Pi
gpt-6-lunaChat Completions, Responsesus, globalCodex, OpenCode, Pi, Oh My Pi
kimi-k3Chat Completions, Responsesus, globalCodex, OpenCode, Pi, Oh My Pi
kimi-k3.1Chat Completions, Responsesus, globalCodex, OpenCode, Pi, Oh My Pi
glm-5.3Chat Completions, Responsesus, globalCodex, OpenCode, Pi, Oh My Pi
deepseek-v3.2Chat Completionsus-east-1, us-east-2, us-west-2, eu-west-2, eu-north-1, ap-northeast-1, ap-south-1, ap-southeast-2, ap-southeast-3, sa-east-1OpenCode, Pi, Oh My Pi

Delete the role, or remove the trust statement.

There’s also an OpenTofu module in infra/customer-onboarding-aws in the Avant repository.