Dashboard/Phase 5: Advanced Patterns
📖 Concept7 min10 XP

Lesson 41: Cloud Providers

Day 41 of 50 · ~7 min read · Phase 5: Advanced Patterns


The Opening Question

Most of this curriculum assumes you're running Claude Code on your laptop or a personal server. But what if your company has strict requirements?

  • "Code can't leave AWS boundaries"
  • "We use Microsoft Azure, not the public cloud"
  • "We need FedRAMP compliance"
  • "Our data residency policies require Europe-only infrastructure"

These aren't edge cases. They're real constraints for teams building production systems.

Here's the question: can you run Claude Code through enterprise cloud providers, or are you stuck with the default Anthropic API?

The answer is yes — but it requires understanding the tradeoffs.


Discovery

Question 1: What cloud providers support Claude Code?

Claude Code doesn't require you to use Anthropic's API directly. You can route it through:

  1. AWS Bedrock — Amazon's managed model service
  2. Google Vertex AI — Google Cloud's AI platform
  3. Microsoft Azure Foundry — Azure's AI service

Each integrates Claude models with your existing cloud infrastructure.

Why would you do this?

  • Compliance: Data stays within your cloud provider's boundaries
  • Existing contracts: Many enterprises already have relationships with AWS, Google, or Azure
  • IAM integration: Use your company's identity and access management
  • Logging: CloudTrail, Cloud Audit Logs, or Azure audit logs capture usage
  • Cost tracking: Bill Claude Code usage to your cloud account
  • VPC isolation: Run Claude Code in your private network

Question 2: How do you configure Claude Code for each provider?

AWS Bedrock:

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

claude --task "review code"

Claude Code automatically routes requests through Bedrock instead of the Anthropic API.

Google Vertex AI:

export GOOGLE_CLOUD_PROJECT=my-project
export GOOGLE_CLOUD_LOCATION=us-central1
export CLAUDE_CODE_USE_VERTEX=true

claude --task "review code"

Microsoft Azure Foundry:

export ANTHROPIC_FOUNDRY_API_KEY=your-foundry-key
export ANTHROPIC_FOUNDRY_ENDPOINT=your-foundry-endpoint
export CLAUDE_CODE_USE_FOUNDRY=true

claude --task "review code"

The key insight: Claude Code's interface doesn't change. You just point it at a different backend.

Question 3: What's the difference in capability or cost?

Cloud providers offer Claude through their platforms, but there are considerations:

Capability:

  • All three providers have Claude 3.5 Sonnet and Haiku
  • Some may not have the absolute latest model (Opus) immediately
  • Extended thinking and some advanced features may vary

Cost:

  • Each provider has their own pricing
  • Sometimes cloud-native pricing is cheaper than direct API (due to volume discounts)
  • Sometimes it's more expensive (management overhead)
  • Cloud providers often have commit pricing (save 10-30% with annual commitments)

Latency:

  • Bedrock is usually fastest if you're already in AWS
  • Vertex AI is fastest if you're in Google Cloud
  • Azure Foundry is fastest if you're in Azure
  • Cross-cloud latency can add 100-200ms

Compliance:

  • AWS Bedrock models don't leave AWS regions
  • Vertex AI models don't leave Google Cloud
  • Azure Foundry keeps data in Azure
  • If you need FedRAMP compliance, only Bedrock and Azure fully support it

Question 4: When should you use a cloud provider instead of the direct API?

It depends on your situation:

Use a cloud provider if:

  • Your company already uses AWS/Google/Azure
  • You have compliance or data residency requirements
  • You want to leverage existing IAM/logging infrastructure
  • Your code lives in a VPC and needs to stay there
  • You want to use your company's cloud contract/budget

Use the direct Anthropic API if:

  • You're an individual or small team without cloud infrastructure
  • You want simplicity (fewer integrations to manage)
  • You want the absolute latest Claude models first
  • You're okay with the Anthropic API terms and compliance model

Hybrid approach (advanced):

  • Use direct API for development (fast, simple)
  • Use Bedrock/Vertex/Foundry for production (compliant, logged, isolated)
  • Different environments, different backends

The Insight

Cloud providers let you integrate Claude Code into enterprise infrastructure, but they're not always necessary. The tradeoff is complexity for compliance. A team starting out should use the direct API. As you scale or hit compliance walls, cloud providers give you a path forward without changing your Claude Code code.

The mental model: Think of cloud providers as hosting options for Claude Code. Just like you can host a web app on your laptop, on Heroku, or on AWS — you can route Claude Code through different backends. The app (Claude Code) stays the same. The infrastructure changes.


Try It

Let's practice understanding which provider you'd use.

  1. Evaluate your situation:

    • What cloud does your company use? (AWS? Google? Azure? None?)
    • Do you have compliance requirements? (HIPAA? FedRAMP? SOC 2?)
    • Where does your code live? (GitHub? GitLab? Bitbucket?)
    • Who pays for AI tools? (Individual? Team? Company?)
  2. Document your choice:

    # Claude Code Provider Decision
    
    ## Current Setup
    - Cloud: [none / AWS / Google / Azure]
    - Compliance: [none / SOC 2 / FedRAMP / HIPAA]
    - Team size: [1 / 2-5 / 5+]
    
    ## Recommendation
    - Provider: [Anthropic API / Bedrock / Vertex AI / Foundry]
    - Reason: [cost / compliance / infrastructure / simplicity]
    - Migration effort: [low / medium / high]
    
  3. If you're already in a cloud provider, try setting it up:

    • Create API credentials for your cloud provider
    • Set the environment variable
    • Run a simple task and verify it works
    • Check the cloud provider's audit logs to see the request
  4. Compare latency:

    • Time a request using the direct API
    • Time the same request using your cloud provider
    • Note the difference (usually 50-200ms)

Key Concepts Introduced

ConceptDefinition
BedrockAWS's managed service for accessing Claude models
Vertex AIGoogle Cloud's AI platform, offering Claude models
Azure FoundryMicrosoft's service for accessing Claude via Azure
Data residencyEnsuring data stays within specific geographic boundaries
ComplianceMeeting regulatory requirements (HIPAA, FedRAMP, SOC 2, etc.)
IAM integrationUsing your cloud provider's identity and access management

Bridge to Lesson 42

You've now learned the advanced patterns of Claude Code:

  • Scaling work (subagents)
  • Automating it (headless)
  • Optimizing it (cost & context)
  • Navigating it (large codebases)
  • Securing it (permissions)
  • Extending it (channels)
  • Hosting it (cloud providers)

Now it's time to put it all together in a practical lab project.

Tomorrow: We'll build a real CI/CD pipeline that uses Claude Code to automatically review pull requests, comment with suggestions, and even auto-fix simple issues — all without human intervention.


← Back to Curriculum · Lesson 42 →