SOP-002: Setting Up Amazon Bedrock
FreshSource: Claude with Amazon Bedrock
Document Control
| Field | Value |
|---|---|
| SOP ID | SOP-002 |
| Version | 1.0 |
| Status | Active |
| Last Updated | 2024-12 |
Overview
Configure Claude access through AWS Bedrock for enterprise deployments.
Prerequisites
- AWS Account with Bedrock access
- Python 3.8+
- boto3 installed
- IAM permissions for Bedrock
Setup Architecture
Step 1: Enable Model Access
- Go to AWS Console → Bedrock
- Navigate to Model access
- Click Manage model access
- Enable Anthropic Claude models
- Submit request (may require approval)
Step 2: Configure AWS Credentials
bash
# Option A: AWS CLI
aws configure
# Option B: Environment variables
export AWS_ACCESS_KEY_ID="AKIA..."
export AWS_SECRET_ACCESS_KEY="..."
export AWS_DEFAULT_REGION="us-east-1"Step 3: Install Dependencies
bash
pip install boto3 anthropicStep 4: Make API Call
python
import boto3
client = boto3.client(
service_name='bedrock-runtime',
region_name='us-east-1'
)
response = client.invoke_model(
modelId='anthropic.claude-3-5-sonnet-20241022-v2:0',
body=json.dumps({
"anthropic_version": "bedrock-2023-05-31",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Hello, Claude!"}
]
})
)
result = json.loads(response['body'].read())
print(result['content'][0]['text'])Model IDs for Bedrock
| Model | Bedrock Model ID |
|---|---|
| Opus 4.5 | anthropic.claude-opus-4-5-20251101-v1:0 |
| Sonnet 4 | anthropic.claude-sonnet-4-20250514-v1:0 |
| Haiku 3.5 | anthropic.claude-3-5-haiku-20241022-v1:0 |
IAM Policy Required
json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"bedrock:InvokeModel",
"bedrock:InvokeModelWithResponseStream"
],
"Resource": "arn:aws:bedrock:*::foundation-model/anthropic.*"
}
]
}Verification Checklist
- [ ] AWS account has Bedrock access
- [ ] Claude models enabled in Model access
- [ ] IAM role/user has Bedrock permissions
- [ ] AWS credentials configured
- [ ] Test call returns response
Troubleshooting
| Issue | Solution |
|---|---|
AccessDeniedException | Check IAM permissions |
ModelNotFound | Enable model in Bedrock console |
ThrottlingException | Request quota increase |
ValidationException | Check request format |