AWS Builder Center
Configuring Claude Code in VS Code with AWS Bedrock

Configuring Claude Code in VS Code with AWS Bedrock

Configuring Claude Code in VS Code to use AWS Bedrock locally. Uses environment variables for a simple and consistent setup.

AI/ML Architect at Ingram Micro

Configuring Claude Code in VS Code with AWS Bedrock

Claude Code can be configured to run through AWS Bedrock instead of calling external APIs directly. For developers already working inside AWS environments, this approach makes it easier to manage access and keep model usage within existing AWS workflows.
While setting this up locally, I wanted a configuration that worked directly inside VS Code without relying on shell-specific environment variables. Defining the required variables in the editor settings turned out to be the simplest approach.
This article walks through how to configure Claude Code in VS Code to use AWS Bedrock using environment variables defined in the editor settings.



Configuring Environment Variables in VS Code

VS Code allows extensions to receive environment variables through the editor configuration. This is useful when an extension needs runtime variables but you want to avoid relying on shell configuration files.
To configure Claude Code:
  1. Open VS Code Settings

  1. Search for Claude Code Environment Variables

  1. Update the configuration in  settings.json 
Example configuration:
"claudeCode.environmentVariables": [
{
"name": "AWS_REGION",
"value": "ap-southeast-1"
},
{
"name": "ANTHROPIC_MODEL",
"value": "arn:aws:bedrock:ap-southeast-1:735902317408:inference-profile/global.anthropic.claude-opus-4-5-20251101-v1:0"
},
{
"name": "CLAUDE_CODE_USE_BEDROCK",
"value": "1"
},
{
"name": "AWS_BEARER_TOKEN_BEDROCK",
"value": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
]
With this configuration in place, the Claude Code extension routes requests through AWS Bedrock instead of using direct API access.



Terminal Configuration (Alternative)

If you prefer running Claude Code from the terminal, the same configuration can be added to the Claude settings file.
Open the configuration file:
open ~/.claude/settings.json
Add the following block:
{
"env": {
"CLAUDE_CODE_USE_BEDROCK": "1",
"AWS_REGION": "ap-southeast-1",
"AWS_BEARER_TOKEN_BEDROCK": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"ANTHROPIC_MODEL": "arn:aws:bedrock:ap-southeast-1:526993662958:inference-profile/global.anthropic.claude-sonnet-4-6"
}
}
This allows the CLI version of Claude Code to use AWS Bedrock with the same configuration.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article