Complete Guide: Claude Code + AWS Bedrock on Windows (VS Code)

Windows VS Code Setup for Claude Code using AWS Bedrock


After searching on internet and youtube I didnt find the exact steps and the page written by claude code on there website (https://code.claude.com/docs/en/amazon-bedrock) is not very clear to do steps for windows and vs code users. Still I tried them but could not make it work on my instance. Then I had to do some deep research and the steps which worked well are published here.

PHASE 1 — One-time AWS Prerequisites

Step 1: Complete Anthropic’s First Time Use (FTU) form

Anthropic models on Bedrock have one extra requirement — you must complete a one-time First Time Use (FTU) form before invoking any Anthropic model. Without it, your first API calls may temporarily succeed but will fail with a 403 error after ~15 minutes. As per latest changes at the AWS end – you don’t need any this step to be done anymore, if you still want just ensure to select claude model and initiate a chat to check whether its accessible or not to you in your account. In case its not working for you – all other steps won’t work anyways.

Go to: AWS Console → Amazon Bedrock → Model catalog → Click any Anthropic model → Complete the use case form

This is a one-time step per AWS account.


Step 2: Verify your IAM permissions

Your AWS IAM user/role must have at minimum these permissions. Attach this policy in IAM:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "bedrock:InvokeModel",
        "bedrock:InvokeModelWithResponseStream",
        "bedrock:ListInferenceProfiles",
        "bedrock:ListFoundationModels"
      ],
      "Resource": [
        "arn:aws:bedrock:*:*:inference-profile/*",
        "arn:aws:bedrock:*:*:application-inference-profile/*",
        "arn:aws:bedrock:*:*:foundation-model/*"
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "aws-marketplace:ViewSubscriptions",
        "aws-marketplace:Subscribe"
      ],
      "Resource": "*"
    }
  ]
}

Step 3: Get your inference profile ID

You must use inference profile IDs — Claude Code uses the Bedrock Invoke API and does not support the Converse API, and direct model IDs with on-demand throughput will fail.

Open PowerShell and run:

aws bedrock list-inference-profiles --region us-east-1 --profile YOUR_PROFILE_NAME

Look for profiles like us.anthropic.claude-sonnet-4-6 or us.anthropic.claude-opus-4-6-v1 in the output.


PHASE 2 — Configure AWS CLI Profiles (for multiple accounts)

Your ~/.aws/credentials file (at C:\Users\YourName\.aws\credentials) should look like this:

[account-work]
aws_access_key_id = AKIA...
aws_secret_access_key = xxxx...

[account-personal]

aws_access_key_id = AKIA…
aws_secret_access_key = xxxx…

And your ~/.aws/config file (C:\Users\YourName\.aws\config):

[profile account-work]
region = us-east-1
output = json

[profile account-personal]

region = us-west-2 output = json

Verify each profile works:

aws sts get-caller-identity --profile account-work
aws sts get-caller-identity --profile account-personal

PHASE 3 — Configure Claude Code Settings

AWS_REGION is a required environment variable — Claude Code does not read from the .aws config file for this setting. You can use settings files for environment variables like AWS_PROFILE that you don’t want to leak to other processes.

The global Claude Code settings file on Windows lives at:

C:\Users\YourName\.claude\settings.json

Open it (create it if it doesn’t exist) and add:

{
  "env": {
    "CLAUDE_CODE_USE_BEDROCK": "1",
    "AWS_REGION": "us-east-1",
    "AWS_PROFILE": "account-work",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "us.anthropic.claude-sonnet-4-6",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "us.anthropic.claude-opus-4-6-v1",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "us.anthropic.claude-haiku-4-5-20251001-v1:0"
  }
}

PHASE 4 — Configure VS Code Extension

Open VS Code → Ctrl+Shift+P“Open User Settings (JSON)”

The environment variables format must be an array of objects with name and value properties. Add this:

{
  "claudeCode.environmentVariables": [
    { "name": "CLAUDE_CODE_USE_BEDROCK", "value": "1" },
    { "name": "AWS_REGION", "value": "us-east-1" },
    { "name": "AWS_PROFILE", "value": "account-work" },
    { "name": "ANTHROPIC_DEFAULT_SONNET_MODEL", "value": "us.anthropic.claude-sonnet-4-6" },
    { "name": "ANTHROPIC_DEFAULT_OPUS_MODEL", "value": "us.anthropic.claude-opus-4-6-v1" },
    { "name": "ANTHROPIC_DEFAULT_HAIKU_MODEL", "value": "us.anthropic.claude-haiku-4-5-20251001-v1:0" }
  ],
  "claudeCode.selectedModel": "sonnet"
}

PHASE 5 — Switching Between AWS Accounts

There are two clean approaches:

Option A — Per-project .claude/settings.json

Inside your project folder, create .claude/settings.json:

{
  "env": {
    "CLAUDE_CODE_USE_BEDROCK": "1",
    "AWS_REGION": "us-east-1",
    "AWS_PROFILE": "account-personal"
  }
}

This overrides the global settings only for that project. Claude Code merges settings with project-level taking priority.

Option B — Quick switch in PowerShell (terminal method)

Before launching Claude Code in a session, set the profile in your terminal:

$env:AWS_PROFILE = "account-personal"
$env:AWS_REGION = "us-east-1"
$env:CLAUDE_CODE_USE_BEDROCK = "1"
claude

Verification

Test each account after setup:

# Confirm AWS identity
aws sts get-caller-identity --profile account-work

# Test Bedrock access directly
aws bedrock list-inference-profiles --region us-east-1 --profile account-work

In VS Code, open the Claude Code panel. If you see authentication errors, open Help → Toggle Developer Tools → Console to see the actual error — this is far more useful than the UI message.


Common Issues on Windows

AWS_PROFILE in settings.json not working — There’s a known bug where AWS_PROFILE set inside Claude Code’s settings.json env block may not be picked up. If it hangs or 403s, set it directly in your PowerShell session with $env:AWS_PROFILE = "profile-name" before launching VS Code as a workaround.

“on-demand throughput isn’t supported” — You’re using a direct model ID. Switch to an inference profile ID (the us.anthropic. prefixed ones from Step 3).

403 error after it initially worked — You skipped the FTU form. Complete it per account.

Model not found — Pin your model versions using specific Bedrock model IDs. If you use model aliases without pinning, Claude Code may attempt to use a newer model version that isn’t available in your Bedrock account.


Posted

in

by

Tags: