Setting up AWS Bedrock with Claude

Published: (December 22, 2025 at 02:43 PM EST)
3 min read
Source: Dev.to

Source: Dev.to

The AI Landscape in 2025

As 2025 draws to a close, the AI race shows no signs of slowing down. New foundational models are being released by OpenAI, Anthropic, Google, and others, and strategic partnerships are announced daily across the stack.

What the hyperscalers are doing

HyperscalerAI OfferingInfrastructure Highlights
GoogleGemini (own model)TPU chips, massive training clusters
MicrosoftDeep ties to OpenAI; new agreements to broaden its AI portfolioAzure AI services, custom chips
Amazon (AWS)Historically lagged (Anthropic deal 2023, Trainium chips)Leading cloud platform, now catching up with Bedrock

Note: Anthropic recently announced a new partnership with Microsoft[link] and OpenAI is in talks with Amazon[link]. Exclusive‑access models are becoming a thing of the past, putting AWS in a strong position to deliver the latest AI capabilities to its customers.

Why use AWS Bedrock for Anthropic models?

  • Enterprise‑grade compliance, security, and billing – leveraging existing AWS accounts simplifies governance.
  • Faster onboarding – large enterprises often face a lengthy relationship‑building process with Anthropic directly.
  • Unified cloud experience – keep compute, storage, and AI services under one roof.

For personal projects, a direct Anthropic Pro/Max plan is usually cheaper and simpler.

Setting Up AWS Bedrock for Anthropic

  1. Open the Bedrock console.
  2. Previously you had to enable models under Configure and learn → Model access.
    • Now foundational models are auto‑enabled on first use.
  3. Go to Chat / Text playground and select an Anthropic model (e.g., Claude Sonnet 4.5).

First‑time use: Anthropic requires a use‑case form. Fill it out; you’ll receive an email confirming your AWS Marketplace subscription. Subsequent model selections are enabled automatically.

Screenshot

Bedrock Playground showing Anthropic models

Configuring AWS Credentials for Claude Code

Claude Code uses the default AWS SDK credentials, so any method that provides those credentials works.

Option A – AWS CLI configuration

aws configure

Option B – Environment variables (access key)

export AWS_ACCESS_KEY_ID=your-access-key-id
export AWS_SECRET_ACCESS_KEY=your-secret-access-key
export AWS_SESSION_TOKEN=your-session-token   # optional, for temporary credentials

Option C – Environment variables (SSO profile)

aws sso login --profile=
export AWS_PROFILE=your-profile-name

Option D – Bedrock API keys

  1. In the Bedrock console, select API keys.
  2. Generate a short‑term or long‑term key with the desired expiration.

Tell Claude Code to use Bedrock

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

Optional environment variables

# Specific Anthropic model IDs
export ANTHROPIC_MODEL='global.anthropic.claude-sonnet-4-5-20250929-v1:0'
export ANTHROPIC_SMALL_FAST_MODEL='us.anthropic.claude-haiku-4-5-20251001-v1:0'

# Or use an application inference profile ARN
export ANTHROPIC_MODEL='arn:aws:bedrock:us-east-2:your-account-id:application-inference-profile/your-model-id'

# Disable prompt caching (if needed)
export DISABLE_PROMPT_CACHING=1

Setting Up the VS Code Claude Code Extension

  1. Open VS Code.
  2. Press Ctrl + Shift + P (or Cmd + Shift + P on macOS) → Preferences: Open User Settings (JSON).
  3. Add (or edit) the claudeCode.environmentVariables array to include the variables you set above. Example:
{
  "claudeCode.environmentVariables": [
    {
      "name": "AWS_PROFILE",
      "value": "your-profile-name"
    },
    {
      "name": "CLAUDE_CODE_USE_BEDROCK",
      "value": "1"
    },
    {
      "name": "AWS_REGION",
      "value": "us-east-1"
    },
    {
      "name": "ANTHROPIC_MODEL",
      "value": "global.anthropic.claude-sonnet-4-5-20250929-v1:0"
    }
  ]
}
  1. Save the file and restart VS Code (or reload the window).

Now the Claude Code extension will route requests through AWS Bedrock, letting you use Anthropic models without a direct Anthropic subscription.

TL;DR

  • Bedrock now auto‑enables Anthropic models.
  • Authenticate via AWS CLI, environment variables, SSO, or Bedrock API keys.
  • Set CLAUDE_CODE_USE_BEDROCK=1 and the appropriate AWS region/model variables.
  • Add those variables to the VS Code claudeCode.environmentVariables JSON setting.

You’re ready to develop with Claude Code on top of AWS Bedrock! 🚀

[
  {
    "name": "AWS_REGION",
    "value": "us-east-1"
  },
  {
    "name": "CLAUDE_CODE_USE_BEDROCK",
    "value": "1"
  }
]

You can add other environment variables or use your preferred authentication method (including the API keys) there. Once configured, reload VS Code and relaunch the Claude Code extension.

Now you’re ready to use Claude Code without being prompted a login:

Claude Code setup screenshot

Back to Blog

Related posts

Read more »