Follow the documentation for configuring sso for awscli.
After configuration, ~/.aws/config will contain something like this:
[sso-session keycore]
sso_start_url = https://keycore.awsapps.com/start
sso_region = eu-west-1
sso_registration_scopes = sso:account:access
[profile sandbox]
sso_session = keycore
sso_account_id = ACCOUNT_ID
sso_role_name = AWSAdministratorAccess
region = eu-west-1
output = json
Now, it's possible to establish a connection with:
aws sso login --profile sandbox
The configurations that claude-bedrock --profile sandbox sets up and uses, can be done by adding the snippet below to .claude/settings.json in the root of the project. This allows for project specific configuration. This is important when owners of specific aws profiles have to pay for the API tokens used in the project
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"awsAuthRefresh": "aws sso login --profile sandbox",
"env": {
"AWS_PROFILE": "sandbox",
"AWS_REGION": "eu-west-1",
"AWS_SDK_LOAD_CONFIG": "1",
"AWS_EC2_METADATA_DISABLED": "true",
"CLAUDE_CODE_USE_BEDROCK": "1",
"ANTHROPIC_MODEL": "eu.anthropic.claude-sonnet-4-5-20250929-v1:0",
"ANTHROPIC_SMALL_FAST_MODEL": "eu.anthropic.claude-haiku-4-5-20251001-v1:0",
"CLAUDE_CODE_MAX_OUTPUT_TOKENS": "4096",
"MAX_THINKING_TOKENS": "1024"
}
}
This is a much simpler than using the script below.
The configuration file is placed in ~/.claude-bedrock. The script will produce some sensible defaults but exact specification of your-aws-profile will be needed, here sandbox is used.
# Claude Bedrock Configuration File
# This file configures the Claude Bedrock wrapper for AWS
[sandbox]
aws_profile = sandbox
aws_region = eu-west-1
anthropic_model = eu.anthropic.claude-3-7-sonnet-20250219-v1:0
anthropic_small_fast_model=eu.anthropic.claude-3-haiku-20240307-v1:0
The script is placed in ~/bin/claude-bedrock
The entire startup process looks something like this:
Of couse, claude-code just needs a terminal to run and starting it up inside vscode is a good idea.
Either way, Claude is now ready for use.

