🤖 AI Summary
A developer published a practical how-to for running the Claude Code VS Code extension against AWS Bedrock instead of Anthropic’s public API, documenting hours of troubleshooting and the exact steps to make it work. The guide explains why enterprise users prefer Bedrock—centralized billing, IAM/VPC security, compliance, and integration with CloudWatch/Lambda—and shows how to enable Claude Sonnet 4.5 in Bedrock, obtain an inference-profile ARN, configure AWS CLI credentials, and validate inference via aws bedrock-runtime invoke-model before touching VS Code. The author also shares common failure modes (e.g., “e is not iterable” from a misconfigured environmentVariables block, PowerShell quoting/base64 errors) and a sample successful response demonstrating token usage.
Key technical details: Bedrock requires enabling model access per region and using inference profiles (preconfigured cross-region profiles like eu.anthropic.claude-sonnet-4-5-v2:0 are recommended) rather than the raw model ID; get the ARN with aws bedrock list-inference-profiles. Test with a request.json that includes "anthropic_version":"bedrock-2023-05-31" and run aws bedrock-runtime invoke-model --model-id <INFERENCE_PROFILE_ARN> --body file://request.json --cli-binary-format raw-in-base64-out. In VS Code settings.json set claude-code.selectedModel and claude-code.environmentVariables (AWS_PROFILE, AWS_REGION, BEDROCK_MODEL_ID, CLAUDE_CODE_USE_BEDROCK) and reload. Required IAM permissions include bedrock:InvokeModel, ListFoundationModels, and ListInferenceProfiles. The write-up is a concise troubleshooting blueprint for enterprises wanting secure, auditable Claude access via Bedrock.
Loading comments...
login to comment
loading comments...
no comments yet