Skip to content

SOP-002: Setting Up Amazon Bedrock

Fresh

Source: Claude with Amazon Bedrock

Document Control

FieldValue
SOP IDSOP-002
Version1.0
StatusActive
Last Updated2024-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

  1. Go to AWS Console → Bedrock
  2. Navigate to Model access
  3. Click Manage model access
  4. Enable Anthropic Claude models
  5. 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 anthropic

Step 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

ModelBedrock Model ID
Opus 4.5anthropic.claude-opus-4-5-20251101-v1:0
Sonnet 4anthropic.claude-sonnet-4-20250514-v1:0
Haiku 3.5anthropic.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

IssueSolution
AccessDeniedExceptionCheck IAM permissions
ModelNotFoundEnable model in Bedrock console
ThrottlingExceptionRequest quota increase
ValidationExceptionCheck request format

See Also

Based on Anthropic Academy courses