Practical articles on AWS architecture, migration, security, and AI tooling — written from the trenches of migrating Go3 OTT to AWS.
Generated with DaVinci.ai
In previous articles in this series, we’ve covered setting up IAM Identity Center for multi-account access and configuring VS Code for AWS CLI and Python tasks. Now, we’ll take it a step further by integrating Claude, Anthropic’s powerful AI assistant, directly into VS Code using AWS Bedrock.
Claude Code is Anthropic’s official IDE integration that brings Claude’s capabilities directly into your development environment. Unlike traditional chatbots, Claude Code can read your codebase, make edits, run commands, and help you build software more efficiently. By connecting it to AWS Bedrock instead of using direct API keys, you get the benefits of enterprise-grade security, centralized billing, and seamless integration with your existing AWS infrastructure.
AWS Bedrock is Amazon’s fully managed service for accessing foundation models from leading AI companies, including Anthropic’s Claude models. It provides a unified API to work with multiple AI models while maintaining your data within your AWS environment.
Benefits of using Bedrock for Claude Code:
Security: All authentication flows through your existing AWS SSO and IAM policies - no API keys stored in VS Code or on your machine.
Cost Management: Usage appears in your AWS billing dashboard alongside other services, making it easier to track and allocate costs.
Compliance: Data stays within your AWS environment and region, helping meet regulatory requirements.
Enterprise Integration: Leverage existing AWS infrastructure, policies, and access controls your organization already has in place.
Here’s how Claude Code integrates with AWS Bedrock:

The authentication and request flow works as follows:
~/.aws/sso/cache/AWS_PROFILE, AWS_REGION)No API keys required - everything authenticates through your existing AWS SSO session.
Before starting this guide, you should have already completed:
✅ AWS CLI installed - Covered in Using VS Code for CLI tasks - Part 2
✅ IAM Identity Center configured - Covered in Easier access to multiple accounts with IAM Identity Center
✅ VS Code installed - Covered in Using VS Code for CLI tasks - Part 1
Additionally, you’ll need:
✅ Claude Code extension - Install from VS Code marketplace: anthropic.claude-code
✅ Bedrock access - Access to AWS Bedrock in your AWS account (we’ll cover this next)
Bedrock is available in specific AWS regions. For this guide, we’ll use eu-north-1 (Stockholm), but you can check availability in other regions:
# List available regions for Bedrock
aws ec2 describe-regions --query "Regions[].RegionName" --output table
Common Bedrock regions include:
us-east-1 (N. Virginia)us-west-2 (Oregon)eu-west-1 (Ireland)eu-north-1 (Stockholm)ap-southeast-1 (Singapore)Claude models in Bedrock are available by default - you don’t need to request access. However, it’s good practice to verify that the models are accessible in your account:

Note: While Claude models are available by default, some other foundation models in Bedrock may require you to request access. If you plan to use models from other providers, you may need to click Modify model access and request access to those specific models.
At the moment of writing this article, the highly anticipated Claude Fable 5 model is already available, however it requires data to be shared directly with Anthropic (see below). The highest usable model through Bedrock is currently Claude Opus 4.8, which provides excellent performance for most tasks while keeping data within your AWS environment.
UPDATE: As of 12 June 2026, Anthropic Claude Fable 5* has been suspended by US regulators due to concerns about data privacy and compliance, see Statement on the US government directive to suspend access to Fable 5 and Mythos 5 for up to date information.
Your IAM user or role needs permissions to invoke Bedrock models. If you’re using IAM Identity Center (as covered in our previous article), you’ll need to update your permission set.
Option A: Create a Custom Permission Set (Recommended)
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"bedrock:InvokeModel",
"bedrock:InvokeModelWithResponseStream",
"bedrock:ListFoundationModels",
"bedrock:GetFoundationModel",
"bedrock:ListInferenceProfiles",
"bedrock:GetInferenceProfile"
],
"Resource": "*"
}
]
}
BedrockUserAccessOption B: Add Inline Policy to Existing Permission Set
If you already have a PowerUserAccess or custom permission set:
Once the permission set is created:
BedrockUserAccess permission setImportant: If you added permissions to an existing permission set, users will automatically get access. If you created a new permission set, you need to assign it as shown above.
If you followed our IAM Identity Center article, you should already have AWS CLI configured with SSO. Let’s create or verify a profile with Bedrock access.
Run the AWS SSO configuration wizard:
aws configure sso
You’ll be prompted for:
SSO session name (Recommended): my-sso
SSO start URL [None]: https://your-company.awsapps.com/start
SSO region [None]: eu-central-1
SSO registration scopes [None]: sso:account:access
Your browser will open for authentication. Log in with your organizational credentials (e.g., Entra ID).
After authentication, select:
Account: Your Account Name (123456789012)
Role: BedrockUserAccess
CLI default client Region [None]: eu-north-1
CLI default output format [None]: json
CLI profile name [BedrockUserAccess-123456789012]: bedrock-access-profile
This creates a profile named bedrock-access-profile in ~/.aws/config:
[profile bedrock-access-profile]
sso_session = my-sso
sso_account_id = 123456789012
sso_role_name = BedrockUserAccess
region = eu-north-1
output = json
[sso-session my-sso]
sso_start_url = https://your-company.awsapps.com/start
sso_region = eu-central-1
sso_registration_scopes = sso:account:access
Login to AWS SSO:
aws sso login --profile bedrock-access-profile
Your browser will open again for authentication. After successful login, test Bedrock access:
# List available Claude models
aws bedrock list-foundation-models \
--profile bedrock-access-profile \
--region eu-north-1 \
--query 'modelSummaries[?contains(modelId, `anthropic.claude`)].[modelId,modelName]' \
--output table
Expected output:
--------------------------------------------------------------------
| ListFoundationModels |
+--------------------------------------------+---------------------+
| anthropic.claude-sonnet-4-20250514-v1:0 | Claude Sonnet 4 |
| anthropic.claude-opus-4-8 | Claude Opus 4.8 |
| anthropic.claude-opus-4-7 | Claude Opus 4.7 |
| anthropic.claude-haiku-4-5-20251001-v1:0 | Claude Haiku 4.5 |
| anthropic.claude-sonnet-4-5-20250929-v1:0 | Claude Sonnet 4.5 |
| anthropic.claude-fable-5 | Claude Fable 5 |
| anthropic.claude-sonnet-4-6 | Claude Sonnet 4.6 |
| anthropic.claude-opus-4-5-20251101-v1:0 | Claude Opus 4.5 |
| anthropic.claude-opus-4-6-v1 | Claude Opus 4.6 |
+--------------------------------------------+---------------------+
AWS Bedrock uses inference profiles to route requests to models. This is important because the model IDs you see in the list above are not what you’ll use in VS Code.
Inference profiles are region-specific endpoints that provide:
For eu-north-1 (Stockholm), you must use inference profile IDs with the eu. prefix:
| Model Name | ❌ Model ID (won’t work) | ✅ Inference Profile ID (use this) |
|---|---|---|
| Claude Opus 4.8 | anthropic.claude-opus-4-8 |
eu.anthropic.claude-opus-4-8 |
| Claude Sonnet 4.6 | anthropic.claude-sonnet-4-6 |
eu.anthropic.claude-sonnet-4-6 |
| Claude Haiku 4.5 | anthropic.claude-haiku-4-5-20251001-v1:0 |
eu.anthropic.claude-haiku-4-5-20251001-v1:0 |
You can list available inference profiles:
aws bedrock list-inference-profiles \
--profile bedrock-access-profile \
--region eu-north-1 \
--query 'inferenceProfileSummaries[?contains(inferenceProfileId, `anthropic`)].[inferenceProfileId,inferenceProfileName]' \
--output table
Key point: Always use the inference profile ID (with region prefix) in your VS Code configuration.
Now that Bedrock access is working, let’s configure VS Code to use it.
If not already installed:
⌘+Shift+X (Mac) or Ctrl+Shift+X (Windows/Linux)AnthropicOpen VS Code settings:
⌘+, (Mac) or Ctrl+, (Windows/Linux){} icon in the top-right to open settings.json{
"claude.apiProvider": "bedrock",
"claude.awsRegion": "eu-north-1",
"claude.model": "eu.anthropic.claude-sonnet-4-6",
"terminal.integrated.env.osx": {
"AWS_PROFILE": "bedrock-access-profile",
"AWS_REGION": "eu-north-1"
},
"terminal.integrated.inheritEnv": true
}
For Windows users, replace terminal.integrated.env.osx with:
"terminal.integrated.env.windows": {
"AWS_PROFILE": "bedrock-access-profile",
"AWS_REGION": "eu-north-1"
}
For Linux users, use:
"terminal.integrated.env.linux": {
"AWS_PROFILE": "bedrock-access-profile",
"AWS_REGION": "eu-north-1"
}
Save the file (⌘+S or Ctrl+S).
For project-specific settings, create .vscode/settings.json in your project root:
{
"claude.model": "eu.anthropic.claude-opus-4-8",
"terminal.integrated.env.osx": {
"AWS_PROFILE": "bedrock-access-profile",
"AWS_REGION": "eu-north-1"
}
}
This allows you to use different models for different projects (e.g., Opus for complex projects, Sonnet for general work).
After configuration, reload the VS Code window:
⌘+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux)Developer: Reload WindowAlternatively, press ⌘+R (Mac) or Ctrl+R (Windows/Linux).
Let’s verify everything is working correctly.
Download and run the test script (included in this article’s repository):
# Navigate to the article directory
cd "path/to/cloud-chronicles/10. AWS Bedrock, Claude Code and VSCode"
# Make script executable
chmod +x test-bedrock-connection.sh
# Run test
./test-bedrock-connection.sh
Expected output:
🔍 Testing AWS Bedrock Connection for Claude Code
==================================================
✅ AWS CLI installed
ℹ️ Using AWS_PROFILE: bedrock-access-profile
ℹ️ Using AWS_REGION: eu-north-1
🔐 Checking AWS Authentication...
✅ Authenticated as:
----------------------------------------------------
| GetCallerIdentity |
+--------------------------------------------------+
| UserId | AROA...@yourcompany.com |
| Account | 123456789012 |
| Arn | arn:aws:sts::123456789012:assumed... |
----------------------------------------------------
🤖 Checking Available Claude Models...
✅ Available Claude models in eu-north-1:
[List of models displayed in table]
🧪 Testing Bedrock API Call...
✅ Can access inference profile: eu.anthropic.claude-sonnet-4-6
==================================================
✅ All tests passed! Claude Code should work in VS Code.
If any test fails, refer to the Troubleshooting section below.
In VS Code:
⌘+Shift+P and type: Claude: FocusIn the Claude Code chat interface, type:
Hello! Can you confirm you're running via AWS Bedrock in eu-north-1?
If everything is configured correctly, Claude will respond, confirming the connection.

Once configured, your daily workflow is simple:
# 1. Login to AWS SSO (once per day)
aws sso login --profile bedrock-access-profile
# 2. Open VS Code
code
# 3. Start using Claude Code!
AWS SSO sessions typically last 8-12 hours. When expired:
# 1. Re-authenticate
aws sso login --profile bedrock-access-profile
# 2. In VS Code: Reload window
# Press ⌘+R (Mac) or Ctrl+R (Windows/Linux)
# Check if authenticated
aws sts get-caller-identity --profile bedrock-access-profile
# If successful, you'll see your user details
# If expired, you'll get an error
Choose the right Claude model for your task:
Inference Profile ID: eu.anthropic.claude-sonnet-4-6
Best for: Daily development tasks, code reviews, refactoring, general questions
Characteristics:
Use when: You need reliable, quick assistance for standard development work
Inference Profile ID: eu.anthropic.claude-opus-4-8
Best for: Complex architecture decisions, system design, challenging debugging
Characteristics:
Use when: Working on complex problems that require deep analysis or novel solutions
Inference Profile ID: eu.anthropic.claude-haiku-4-5-20251001-v1:0
Best for: Quick questions, simple code generation, documentation
Characteristics:
Use when: You need quick answers or are generating simple code snippets
Note: While Anthropic has released Claude Fable 5 as their latest model, we do not recommend using it with Bedrock for this setup. Fable 5 requires data to be shared directly with Anthropic rather than keeping it within your AWS environment, which defeats one of the primary benefits of using Bedrock:
Why use Bedrock instead: When using Claude Opus 4.8, Sonnet 4.6, or Haiku 4.5 through Bedrock:
For most enterprise and production use cases, Claude Opus 4.8 via Bedrock provides excellent capability while maintaining data within your AWS infrastructure.
Symptoms: Claude Code shows authentication errors
Solutions:
aws sts get-caller-identity --profile bedrock-access-profile
aws sso login --profile bedrock-access-profile
echo $AWS_PROFILE
echo $AWS_REGION
⌘+R)Symptoms: Error about model not being available
Solutions:
eu. prefix):
eu.anthropic.claude-sonnet-4-6anthropic.claude-sonnet-4-6aws bedrock list-inference-profiles \
--profile bedrock-access-profile \
--region eu-north-1
Update settings.json with correct inference profile ID
Symptoms: Terminal shows empty $AWS_PROFILE
Solutions:
settings.json:
osx, windows, or linux)terminal.integrated.inheritEnv is trueClose all terminal windows in VS Code
# Quit VS Code
# Reopen VS Code
echo $AWS_PROFILE
echo $AWS_REGION
Symptoms: AWS CLI works, but Bedrock calls fail
Solutions:
# Test Bedrock access directly
aws bedrock list-foundation-models \
--profile bedrock-access-profile \
--region eu-north-1
bedrock:InvokeModelbedrock:ListFoundationModelsbedrock:ListInferenceProfilesSymptoms: Error about Bedrock not available in region
Solutions:
aws bedrock list-foundation-models --region eu-north-1
claude.awsRegion in settings.jsonAWS_REGION environment variableus-east-1, us-west-2, eu-west-1, eu-north-1Create project-specific configurations in .vscode/settings.json:
Production project (using production AWS account):
{
"claude.model": "eu.anthropic.claude-opus-4-8",
"terminal.integrated.env.osx": {
"AWS_PROFILE": "production-bedrock",
"AWS_REGION": "eu-west-1"
}
}
Development project (using dev account, cheaper model):
{
"claude.model": "eu.anthropic.claude-haiku-4-5-20251001-v1:0",
"terminal.integrated.env.osx": {
"AWS_PROFILE": "dev-bedrock",
"AWS_REGION": "eu-north-1"
}
}
Create a CLAUDE.md file in your project root to give Claude project-specific context:
# Project: Cloud Chronicles
This is a technical blog about AWS cloud architecture.
## Code Style
- Use clear, educational examples
- Include comments explaining "why"
- Prefer AWS CLI over SDK examples
## Conventions
- All examples use `eu-north-1` region
- Use IAM Identity Center, not access keys
- Reference previous articles when relevant
Claude Code automatically reads this file and applies the context to all conversations.
Monitor and optimize Bedrock costs:
# Example: Create CloudWatch alarm for Bedrock costs
aws cloudwatch put-metric-alarm \
--alarm-name bedrock-cost-alert \
--alarm-description "Alert when Bedrock costs exceed threshold" \
--metric-name EstimatedCharges \
--namespace AWS/Billing \
--statistic Maximum \
--period 86400 \
--evaluation-periods 1 \
--threshold 100.0 \
--comparison-operator GreaterThanThreshold
This setup requires no AWS credentials files or API keys. By using AWS SSO, you authenticate through your browser, and the AWS CLI manages temporary session tokens automatically in ~/.aws/sso/cache/. These tokens:
What you should add to .gitignore (if applicable to your project):
# Only if you're working with other AWS services that generate files
*.pem
*.key
# VS Code workspace settings (if they contain account-specific info)
.vscode/settings.local.json
Note: The ~/.aws/config file only contains profile configurations and SSO URLs - no secrets. The ~/.aws/sso/cache/ directory contains temporary tokens managed by AWS CLI.
This AWS SSO approach provides several security advantages over traditional API keys:
Automatic expiry: Credentials expire after the configured session duration (typically 8-12 hours)
No long-lived secrets: No API keys or access keys stored anywhere
Centralized control: Access can be revoked instantly from IAM Identity Center
Audit trail: All authentication events logged in AWS CloudTrail
Grant only necessary Bedrock permissions:
{
"Effect": "Allow",
"Action": [
"bedrock:InvokeModel",
"bedrock:InvokeModelWithResponseStream"
],
"Resource": [
"arn:aws:bedrock:eu-north-1::foundation-model/anthropic.claude-*"
]
}
Monitor Bedrock usage with CloudTrail:
# Query recent Bedrock API calls
aws cloudtrail lookup-events \
--lookup-attributes AttributeKey=ResourceType,AttributeValue=AWS::Bedrock::Model \
--max-results 10 \
--profile bedrock-access-profile
Login fresh each day rather than relying on long-lived sessions:
# Daily routine
aws sso logout
aws sso login --profile bedrock-access-profile
Understanding Bedrock pricing helps manage costs effectively.
Bedrock charges based on:
Prices vary by model (as of June 2026):
| Model | Input (per 1M tokens) | Output (per 1M tokens) |
|---|---|---|
| Claude Opus 4.8 | $15.00 | $75.00 |
| Claude Sonnet 4.6 | $3.00 | $15.00 |
| Claude Haiku 4.5 | $0.25 | $1.25 |
Note: Prices are examples and may vary by region and change over time. Check AWS Bedrock pricing for current rates.
Daily development (Sonnet):
Heavy usage (Opus):
Light usage (Haiku):
You’ve now successfully configured Claude Code to work with AWS Bedrock in VS Code! Here’s what we covered:
✅ Enabled Bedrock access and requested Claude model access ✅ Configured IAM permissions for Bedrock ✅ Set up AWS CLI profile with SSO authentication ✅ Understood inference profiles vs model IDs ✅ Configured VS Code with Claude Code extension ✅ Verified installation with test script ✅ Learned daily workflow and troubleshooting
CLAUDE.md files for project-specific contextHappy coding with Claude!