AWS Bedrock
AWS Bedrock allows you to use Anthropic Claude models hosted within your own AWS account. This provider invokes Bedrock via the AWS CLI, which means it benefits from your existing AWS SSO and IAM configuration.
Provider Details
| Property | Value |
|---|---|
| Config key | bedrock |
| Default model | us.anthropic.claude-sonnet-4-20250514-v1:0 |
| Auth method | AWS CLI profile (supports SSO, IAM roles, and credential chains) |
Configuration
yaml
ai:
default_provider: bedrock
providers:
bedrock:
aws_profile: your-bedrock-aws-profile
region: us-east-1
model: us.anthropic.claude-sonnet-4-20250514-v1:0The aws_profile field specifies which AWS CLI profile to use for Bedrock API calls. This can be different from the profile used for infrastructure queries.
Environment Variables
Bedrock authentication relies on standard AWS environment variables and credential chains. No Clanker-specific environment variable is needed. The AWS CLI profile referenced in aws_profile must have bedrock:InvokeModel permissions.
CLI Flag Overrides
| Flag | Description |
|---|---|
--ai-profile bedrock | Select this provider |
There are no dedicated key or model override flags for Bedrock. To change the model, update ai.providers.bedrock.model in the config file.
Setup
- Ensure your AWS CLI profile has access to Amazon Bedrock in the specified region.
- Request access to the desired model in the Bedrock console if you have not already done so.
- Verify access:
bash
aws bedrock-runtime invoke-model \
--model-id us.anthropic.claude-sonnet-4-20250514-v1:0 \
--body '{"anthropic_version":"bedrock-2023-05-31","max_tokens":100,"messages":[{"role":"user","content":"Hello"}]}' \
--profile your-bedrock-aws-profile \
--region us-east-1 \
/dev/stdoutUsage Example
yaml
# ~/.clanker.yaml
ai:
default_provider: bedrock
providers:
bedrock:
aws_profile: commercial-dev
region: us-east-1
model: us.anthropic.claude-sonnet-4-20250514-v1:0bash
clanker ask "What ECS services are running?"Notes
- Bedrock uses the AWS CLI
bedrock-runtime invoke-modelcommand under the hood. Request and response data are exchanged through temporary files to avoid command-line length limits. - Because Bedrock runs within your AWS account, data does not leave your infrastructure. This makes it suitable for environments with strict data residency requirements.
- Clanker retries Bedrock requests up to 5 times with exponential backoff if a transient error (throttling, overload) is detected.