Claude Code + Amazon Bedrock
Hackathon Cheatsheet
Workshop: GenAI Hackathon on AWS Workshop Studio
Quick Setup
# 1. Enable Bedrock
export CLAUDE_CODE_USE_BEDROCK=1
export AWS_REGION=us-west-2
# 2. Pin models (recommended — avoids defaulting to expensive Opus)
export ANTHROPIC_MODEL='us.anthropic.claude-sonnet-4-6'
export ANTHROPIC_DEFAULT_HAIKU_MODEL='us.anthropic.claude-haiku-4-5-20251001-v1:0'
# 3. Paste your Workshop Studio credentials (see below)
export AWS_ACCESS_KEY_ID="PASTE_HERE"
export AWS_SECRET_ACCESS_KEY="PASTE_HERE"
export AWS_SESSION_TOKEN="PASTE_HERE"
# 4. Launch
claude
At the login prompt → 3rd-party platform → Amazon Bedrock
Getting & Refreshing Credentials
First time — getting credentials
- Log into your Workshop Studio event at the URL and access code provided by the event organiser
- In the left sidebar, click "Get AWS CLI credentials" (or the equivalent credentials panel)
- Copy the block containing
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY, andAWS_SESSION_TOKEN - Paste into your terminal before launching
claude
When credentials expire
You'll know they've expired when you see errors like:
ExpiredTokenExceptionThe security token included in the request is expiredAccess denied/ 403 errors that weren't happening before
To refresh:
- Go back to your Workshop Studio browser tab (keep it open throughout the hackathon)
- Click the credentials panel again — Workshop Studio will show you fresh credentials
- In your terminal, stop Claude Code (
Ctrl+Cor type/exit) - Re-export all three credential variables with the new values:
export AWS_ACCESS_KEY_ID="<new value>" export AWS_SECRET_ACCESS_KEY="<new value>" export AWS_SESSION_TOKEN="<new value>" - Restart Claude Code:
claude
💡 Tip: Credentials typically refresh every 1–4 hours. Keep your Workshop Studio browser tab open — you'll need it multiple times during the hackathon.
⚠️ Do NOT create IAM users or generate long-lived access keys. This violates Workshop Studio security policies and may trigger account termination.
Key Constraints
| Item | Limit |
|---|---|
| Bedrock regions | us-west-2 and us-east-1 only |
| Models | Only WS-approved models |
| GPU/Accelerated instances | ❌ Not available (0 vCPU quota) |
| WebSearch tool | ❌ Not available on Bedrock |
| Event duration | Max 72 hours |
Troubleshooting
| Problem | Fix |
|---|---|
| "Model not available" | Use us.anthropic.claude-sonnet-4-6 (with us. prefix) |
| "On-demand throughput isn't supported" | Switch to inference profile format: us.anthropic.claude-sonnet-4-6 not anthropic.claude-sonnet-4-6 |
| Expired credentials | Re-copy from Workshop Studio console, re-export, restart claude |
| Slow / throttled responses | Shared capacity across all participants — use Haiku for background tasks |
Tips
- Use Sonnet as primary model — fast, capable, cost-effective
- Avoid rapid automated loops — Bedrock capacity is shared across the event
- Never commit credentials to GitHub — even temporary ones
- Use
/compactin Claude Code to manage long conversations - Run
/statusto verify your connection is working