// AI Coding Tools

Claude Code with AWS Bedrock: 6-Minute Setup Guide (2026)

Ghost Dev Explains
Updated May 19, 2026
3 min readintermediate
// quick answer

Run Claude Code on AWS Bedrock by enabling model access, creating scoped AWS credentials, installing the CLI, and setting CLAUDE_CODE_USE_BEDROCK with your region and model ID.

// video

Claude Code can talk to Anthropic directly, or it can run through AWS Bedrock. The Bedrock route is common in companies that already have an AWS account, an IAM process, and a billing workflow. Requests stay inside your AWS account, and you control access with policies instead of sharing a personal API key.

The setup is short if you do it in the right order: enable model access, create credentials, install the CLI, configure the environment, then test.

Step 1: Enable Claude model access

Open the Bedrock console and go to model access. Request access to the Claude model you want to use. Some models are available immediately; others require a short approval step.

If the console says the model is not available in your region, switch to a supported region. The video uses a US region because that is where the Claude models were available at the time.

Step 2: Create AWS credentials

Do not use the root account. Create an IAM user or role with permission to invoke Bedrock models. The minimum permissions are in the bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream family.

For local development, configure an AWS profile:

aws configure --profile ghostdev

Enter the access key, secret key, and region. Then export the profile:

export AWS_PROFILE=ghostdev

On Windows PowerShell:

$env:AWS_PROFILE = "ghostdev"

If you are already signed in with a role, the CLI can use that role instead of an access key.

Step 3: Install Claude Code

Install Node.js 18 or newer, then install the CLI:

npm install -g @anthropic-ai/claude-code

Check it:

claude --version

Step 4: Point Claude Code at Bedrock

Set the Bedrock flag and the region:

export CLAUDE_CODE_USE_BEDROCK=1
export AWS_REGION=us-east-1

Windows PowerShell:

$env:CLAUDE_CODE_USE_BEDROCK = "1"
$env:AWS_REGION = "us-east-1"

Then set the model. Bedrock model IDs are different from Anthropic API model names, and many models use an inference profile ID. Copy the exact value from the Bedrock console:

export ANTHROPIC_MODEL="YOUR_BEDROCK_MODEL_ID"

If the model requires an inference profile, use the profile ID, not the bare foundation model ID.

Step 5: Test it

Start Claude Code in a small project:

claude

Ask it to explain a file:

Explain what src/index.js does and list any obvious bugs.

If the request fails, work through these checks in order:

  1. Is model access granted in the console?
  2. Is the region the same in the console and the environment?
  3. Do the IAM credentials have invoke permission?
  4. Is the model ID an exact copy from the console?
  5. Does the account have a valid payment method or credits?

Cost control

Bedrock charges per token. Set an AWS budget alert before you use it for long sessions. Claude Code can send a lot of context when it reads several files, so a long agent session costs more than a single chat message.

Use a cheaper model for simple edits and the stronger model only when the task needs it. Keep the AWS profile separate from your production credentials.

Common mistakes

  • Using an Anthropic model name on Bedrock. The IDs are different.
  • Granting access in one region and calling another. Region mismatch is the most common failure.
  • Hardcoding access keys. Use a profile or role.
  • Skipping the budget alert. AI coding can generate surprising usage.
  • Forgetting to enable streaming permissions. Some CLI features stream responses.

Final thoughts

The Bedrock setup is a good fit if you want Claude Code under your AWS account and IAM controls. Enable the model, create a scoped profile, install the CLI, set the Bedrock flag, and paste the exact model ID. Once it works, save the environment values in a safe place so the next machine takes minutes instead of an evening.

// key takeaways
  • Enable model access in Bedrock before installing anything.
  • Create scoped IAM credentials with Bedrock invoke permissions.
  • Set CLAUDE_CODE_USE_BEDROCK, AWS_REGION, and the correct model ID.
  • Use an AWS profile instead of hardcoding keys in your shell history.
  • Check the Bedrock console for the exact model or inference profile ID.
// FAQ
Why use Bedrock instead of a Claude subscription?
Bedrock bills through AWS, keeps requests inside your AWS account, and lets you control access with IAM. It is useful when your company already runs on AWS.
Which region should I use?
Use a region where the Claude model you want is available and where you have model access granted. The region in your CLI config must match.
Why does the model ID fail?
Bedrock uses its own model IDs and inference profile IDs. Copy the exact ID from the Bedrock console instead of reusing an Anthropic API model name.
Is this free?
No. Bedrock is pay per token. The advantage is control and AWS billing, not a free tier.