AWS Bedrock Guide 2025: Managed Foundation Models on AWS
A practical guide to AWS Bedrock for enterprise developers — from first API call to production RAG pipelines and agentic workflows.
What Is AWS Bedrock?
AWS Bedrock is Amazon's fully managed service for accessing foundation models (FMs) from multiple providers — Anthropic, Meta, Mistral AI, Stability AI, Cohere, and Amazon itself — all through a unified API. You don't provision GPU instances or manage model serving infrastructure; AWS handles all of that.
The key enterprise value proposition: your data stays in your AWS account, is not used to train any model, and can be locked to specific AWS regions for data residency. Bedrock is fully integrated with AWS IAM, CloudTrail, VPC endpoints, and PrivateLink.
Bedrock is the right choice when your team already runs workloads on AWS, needs compliance certifications (SOC 2, HIPAA, FedRAMP High), or wants to use multiple foundation models without juggling separate vendor accounts.
Available Models (2025)
| Provider | Models | Best for |
|---|---|---|
| Anthropic | Claude 3.5 Sonnet, Haiku, Opus | Coding, analysis, long context (200k) |
| Meta | Llama 3.3 70B, Llama 3.1 8B/70B/405B | Open weights, fine-tuning |
| Mistral | Mistral Large, Mistral Small | EU compliance, multilingual |
| Amazon | Titan Text G1, Titan Embeddings | AWS-native, embeddings for RAG |
| Stability AI | Stable Diffusion XL, SD3 | Image generation via API |
Model availability varies by AWS region. Enable model access in the Bedrock console under Model access before first use — some models require a use-case form.
IAM Setup
Your IAM role or user needs the bedrock:InvokeModel permission. Attach this policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"bedrock:InvokeModel",
"bedrock:InvokeModelWithResponseStream"
],
"Resource": "arn:aws:bedrock:us-east-1::foundation-model/*"
}
]
} For Knowledge Bases and Agents, add bedrock:Retrieve and bedrock:InvokeAgent respectively.
Converse API (Recommended)
The Converse API provides a unified chat interface that works across all text models on Bedrock — the same code works for Claude, Llama, or Mistral by just changing the modelId.
pip install boto3
import boto3
client = boto3.client(
service_name='bedrock-runtime',
region_name='us-east-1' # choose the region where you enabled the model
)
response = client.converse(
modelId='anthropic.claude-3-5-sonnet-20241022-v2:0',
messages=[
{
"role": "user",
"content": [{"type": "text", "text": "Explain AWS Bedrock in 3 sentences."}]
}
],
system=[{"text": "You are a concise AWS expert."}]
)
print(response['output']['message']['content'][0]['text']) Model IDs use provider prefixes. Claude models are anthropic.claude-*, Llama is meta.llama*. Get the exact ID from the Bedrock console under Model catalog.
Knowledge Bases (Managed RAG)
Bedrock Knowledge Bases automates the RAG pipeline: upload documents to S3, and Bedrock handles chunking, embedding (via Titan Embeddings), and storage (Amazon OpenSearch Serverless by default). You query it with a single API call:
bedrock_agent = boto3.client('bedrock-agent-runtime', region_name='us-east-1')
response = bedrock_agent.retrieve_and_generate(
input={"text": "What is our refund policy?"},
retrieveAndGenerateConfiguration={
"type": "KNOWLEDGE_BASE",
"knowledgeBaseConfiguration": {
"knowledgeBaseId": "YOUR_KB_ID",
"modelArn": "arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-5-sonnet-20241022-v2:0"
}
}
)
print(response['output']['text']) Agents & Guardrails
Bedrock Agents
Build automated workflows where the model decides which actions to take. You define action groups (Lambda functions or API schemas), and the agent uses ReAct-style reasoning to call them. Common use cases: order processing bots, IT helpdesk automation, data lookup agents.
Guardrails
Configure content filtering for your Bedrock calls — block categories (hate speech, violence, sexual content, prompt injection), define topic deny lists (e.g. block competitor mentions), and redact PII. Guardrails apply consistently across any model on Bedrock, so you don't configure them per-model.
Fine-tuning
Bedrock supports fine-tuning on Amazon Titan and some Meta Llama models using your own JSONL training data stored in S3. Upload a training file, start a fine-tuning job via the console or API, and the result is a private model variant available only in your account.
Pricing (On-Demand)
| Model | Input (per 1M tokens) | Output (per 1M tokens) |
|---|---|---|
| Claude 3.5 Sonnet | $3.00 | $15.00 |
| Claude 3.5 Haiku | $0.80 | $4.00 |
| Llama 3.1 70B | $0.72 | $0.72 |
| Mistral Large | $3.00 | $9.00 |
| Amazon Titan Embeddings | $0.02 | N/A |
Provisioned Throughput (reserved model units) reduces latency for high-volume workloads but requires a 1-month or 6-month commitment. Check the AWS Bedrock pricing page for the latest rates.
Bedrock vs Azure OpenAI vs Vertex AI
| Platform | Models | Cloud home | Best for |
|---|---|---|---|
| AWS Bedrock | Claude, Llama, Titan, Mistral, SD | AWS | Multi-model, AWS-native teams |
| Azure OpenAI | GPT-4o, o3, DALL-E, Whisper | Azure | Microsoft/Azure shops, GPT-4o focus |
| Vertex AI | Gemini, Llama, Claude, Mistral | GCP | Google Workspace teams, Gemini models |
See also: Azure OpenAI guide, Vertex AI guide, Anthropic API guide, LlamaIndex guide.
Monitor AWS & Anthropic Status
Bedrock inherits AWS regional status — an outage in us-east-1 can affect Claude on Bedrock while the direct Anthropic API stays up. Prismix tracks both AWS and Anthropic live status.