ailiteracynepal 🇳🇵
Text size

Chapter 05 · Section II · 12 min read

5.2 Cloud providers: Bedrock and Vertex setup

Concrete setup steps for AWS Bedrock and Google Vertex as Claude Code providers — enabling access, model IDs, regions, and the settings.json shape.

The IAM section covered why enterprises reach for Bedrock or Vertex; this one covers the concrete “get it working” steps. Both providers work; the setup involves an enable-access flow, a model-id conversion, a region choice, and a small settings block.

AWS Bedrock

1. Enable Anthropic models.

In the AWS console: Bedrock → Model access → Request access for the Anthropic family. Approval is usually instant for the flagship models; some legacy ones need a form.

2. Note the Bedrock model IDs.

Bedrock uses a distinct naming scheme:

anthropic.claude-opus-4-7-20260101-v1:0
anthropic.claude-sonnet-4-6-20250501-v1:0
anthropic.claude-haiku-4-5-20251001-v1:0

Claude Code maps the plain names to Bedrock IDs, but you can also specify the Bedrock ID explicitly.

3. Configure.

{
  "provider": "bedrock",
  "aws": {
    "region": "us-east-1",
    "profile": "engineering"
  },
  "model": "anthropic.claude-sonnet-4-6-20250501-v1:0"
}

The AWS credential chain kicks in — same rules as the AWS CLI.

4. Verify.

claude --print "hello" --output-format json | jq '.result'

If auth or model access is misconfigured, the JSON envelope contains an error subtype pointing at what to fix.

Google Vertex

1. Enable the Vertex AI API and the Anthropic model in your project.

gcloud services enable aiplatform.googleapis.com

Then in the console: Vertex AI → Model Garden → Anthropic → Enable.

2. Configure.

{
  "provider": "vertex",
  "vertex": {
    "project": "my-gcp-project",
    "location": "us-central1"
  },
  "model": "claude-sonnet-4-6@20250501"
}

Vertex uses @-versioned model names.

3. Auth.

Standard GCP: gcloud auth application-default login for a laptop, service accounts / Workload Identity for infrastructure.

Choosing a region

Rules of thumb:

  • Latency — closest to your developers or your build infrastructure.
  • Compliance — data residency, sovereign clouds, EU-specific regions.
  • Model availability — not every region hosts every model on day one.

Cross-account / cross-project access

If your Claude Code laptops sit in one AWS account but Bedrock runs in another, use AWS cross-account role assumption:

{
  "aws": {
    "role_arn": "arn:aws:iam::123456789012:role/bedrock-consumer"
  }
}

Same idea on GCP with Workload Identity Federation and impersonation.

Check your understanding

Quick check

You just enabled Bedrock in `eu-west-1` and configured Claude Code to use it, but calls fail with a model-access error. What is the most likely fix?