๐ Community-Driven Knowledge Hub
We welcome contributions to build the most comprehensive amazon-bedrock hands-on resource!
๐ข How You Can Help:
- ๐ Report Issues
- ๐ก Suggest New Guides
- โ๏ธ Submit Article Improvements
- ๐ Add Missing Concepts
- โ Review Open PRs
A comprehensive collection of hands-on guides for mastering Amazon Bedrock with Infrastructure as Code (IaC) using AWS CDK. This repository provides practical, real-world examples to help you learn and implement Amazon Bedrock's powerful AI/ML capabilities.
- About
- Prerequisites
- Repository Structure
- Getting Started
- Available Guides
- Upcoming Guides
- Usage
- Contributing
- Cost Considerations
- Support
- License
Amazon Bedrock is a fully managed service that offers a choice of high-performing foundation models (FMs) from leading AI companies through a single API. This repository provides step-by-step hands-on guides to help you:
- Learn by doing with practical, deployable examples
- Understand core concepts through real-world implementations
- Deploy infrastructure using AWS CDK for reproducible environments
- Explore different AI models and their capabilities
- Build production-ready solutions with best practices
- Developers looking to integrate AI capabilities into applications
- DevOps Engineers wanting to deploy AI infrastructure as code
- Solutions Architects designing AI-powered systems
- Students and Learners exploring Amazon Bedrock capabilities
- AI Enthusiasts interested in hands-on AWS AI services
Before starting with these guides, ensure you have:
# AWS CLI v2
aws --version
# AWS CDK
npm install -g aws-cdk
cdk --version
# Python 3.8+
python --version
# Git
git --version- โ AWS Account with appropriate permissions
- โ AWS CLI configured with credentials
- โ Amazon Bedrock model access enabled
- โ Basic understanding of AWS services
- Basic AWS concepts (IAM, Lambda, S3, API Gateway)
- Python programming fundamentals
- Command line interface familiarity
- Infrastructure as Code concepts
amazon-bedrock/
โโโ 01-fundamentals/ # Bedrock basics and core concepts
โโโ 02-image-generation/ # AI image generation with Titan
โโโ 03-background-removal/ # Image editing and manipulation
โโโ 04-generate-embedding/ # Text embeddings and vector operations
โโโ docs/ # Additional documentation
โโโ scripts/ # Utility scripts
โโโ LICENSE # MIT License
โโโ README.md # This file
Each guide directory contains:
guide-name/
โโโ README.md # Guide-specific instructions
โโโ app.py # CDK app entry point
โโโ requirements.txt # Python dependencies
โโโ lambda/ # Lambda function code
โ โโโ index.py
โโโ guide-name/ # CDK stack definitions
โ โโโ stack.py
โโโ tests/ # Unit tests (where applicable)
git clone https://github.com/anveshmuppeda/amazon-bedrock.git
cd amazon-bedrock# Create virtual environment (recommended)
python -m venv bedrock-env
source bedrock-env/bin/activate # On Windows: bedrock-env\Scripts\activate
# Install global dependencies
pip install -r requirements.txtcdk bootstrap aws://ACCOUNT-NUMBER/REGION- Navigate to Amazon Bedrock Console
- Go to "Model access" in the left sidebar
- Click "Enable specific models"
- Enable required models for your chosen guide
- Wait for approval (usually immediate for most models)
Start with 01-fundamentals for beginners or jump to any specific use case that interests you!
Level: Beginner | Duration: 30 minutes | Cost: ~$0.50
Learn the basics of Amazon Bedrock, understand different models, and make your first API calls.
What you'll build:
- Simple Bedrock API integration
- Text generation with Claude
- Basic Lambda function setup
Key concepts: Foundation models, API calls, text generation
Level: Intermediate | Duration: 45 minutes | Cost: ~$2.00
Build a complete image generation API using Amazon Titan Image Generator.
What you'll build:
- REST API for image generation
- S3 storage integration
- Presigned URL generation
- CORS-enabled API Gateway
Key concepts: Image generation, API Gateway, S3 integration, presigned URLs
Level: Intermediate | Duration: 50 minutes | Cost: ~$2.00
Create an intelligent background removal service using Amazon Titan Image Generator V2.
What you'll build:
- AI background removal API with S3 integration
- RESTful service with API Gateway and Lambda
- Presigned URL generation for secure image access
- Production-ready infrastructure with CDK
Key concepts: AI image processing, S3 integration, presigned URLs, error handling
Level: Intermediate | Duration: 45 minutes | Cost: ~$1.00
Build a text embedding generation service using Amazon Titan Embeddings G1 model.
What you'll build:
- Text embedding API that converts text to 1536-dimensional vectors
- RESTful service with API Gateway and Lambda integration
- Semantic search foundation for AI applications
- Vector generation pipeline for machine learning workflows
Key concepts: Text embeddings, vector dimensions, semantic applications, API design
Level: Intermediate | Duration: 60 minutes | Cost: ~$3.00
Build an intelligent chatbot with conversation memory using Amazon Bedrock, LangChain, and Streamlit.
What you'll build:
- Intelligent chatbot with conversation memory and context awareness
- Streamlit web interface for interactive chat experience
- AWS ECS deployment with Application Load Balancer
- Conversation memory using LangChain's ConversationSummaryBufferMemory
Key concepts: Conversation memory, LangChain integration, Streamlit state management, container orchestration
Level: Advanced | Duration: 75 minutes | Cost: ~$4.00
Build a production-ready Retrieval-Augmented Generation (RAG) system for intelligent Q&A over documents.
What you'll build:
- Document processing pipeline that converts PDFs to searchable vectors
- Intelligent Q&A system that answers questions based on document content
- Vector search engine using FAISS for fast similarity matching
- RAG architecture combining retrieval and generation
Key concepts: RAG architecture, vector embeddings, document processing, FAISS database, semantic search
Level: Intermediate | Duration: 55 minutes | Cost: ~$3.50
Build a beautiful web-based AI image generator using Amazon Titan Image Generator G1 and Streamlit.
What you'll build:
- Interactive web UI for AI image generation from text prompts
- Real-time image generation using Amazon Titan Image Generator G1
- Streamlit frontend with modern, responsive design
- Image download functionality for saving generated images
Key concepts: AI image generation, Streamlit development, session management, user experience design
Level: Advanced | Duration: 70 minutes | Cost: ~$5.00
Build a comprehensive AI-powered image processing hub combining multiple AI capabilities in a unified interface.
What you'll build:
- Unified AI hub with multiple image processing capabilities
- Text-to-image generation using Amazon Titan Image Generator G1
- AI background removal using Amazon Titan Image Generator V2
- Tabbed interface for seamless feature switching
- Before/after comparisons and complete workflow pipelines
Key concepts: Multi-feature AI applications, modular architecture, dual model integration, workflow design
We're continuously adding new guides! Here's what's coming next:
| Guide | Level | Status |
|---|---|---|
| RAG Implementation | Advanced | ๐๏ธ In Progress |
| Chatbot with Memory | Intermediate | ๐ Planned |
| Document Analysis | Advanced | ๐ Planned |
| Multi-Modal AI | Expert | ๐ Planned |
| Model Fine-Tuning | Expert | ๐ Planned |
| Production Monitoring | Advanced | ๐ Planned |
Want to suggest a guide? Open an issue with the tag guide-request.
-
Navigate to the guide directory:
cd 02-image-generation # Replace with your chosen guide
-
Install dependencies:
pip install -r requirements.txt
-
Review the guide README:
cat README.md
-
Deploy the infrastructure:
cd image-generation # Adjust path as needed cdk deploy
-
Test the deployment: Follow the testing instructions in each guide's README.
-
Clean up resources:
cdk destroy
- ๐ Security: Always follow AWS security best practices
- ๐ฐ Cost: Monitor your AWS costs and clean up resources after testing
- ๐ท๏ธ Tagging: Use consistent resource tagging for organization
- ๐ Documentation: Read each guide's README thoroughly before starting
- ๐งช Testing: Test in a development environment first
We welcome contributions from the community! Here's how you can help:
- ๐ Report bugs by opening an issue
- ๐ก Suggest improvements or new guide ideas
- ๐ Improve documentation with clearer explanations
- ๐ง Submit code improvements via pull requests
- โญ Share the repository to help others learn
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-guide - Follow the existing code style and structure
- Test your changes thoroughly
- Update documentation as needed
- Submit a pull request with a clear description
When contributing a new guide, please include:
- Clear README with step-by-step instructions
- Working CDK code with proper error handling
- Cost estimates and time requirements
- Prerequisites and learning objectives
- Testing instructions with sample inputs/outputs
*Costs are estimates for testing/learning purposes and may vary based on usage
- ๐ Clean up resources immediately after testing
- ๐ Monitor AWS billing dashboard regularly
- ๐ฏ Use AWS Free Tier where applicable
- ๐ Set billing alerts for cost control
- ๐๏ธ Implement lifecycle policies for S3 storage
- ๐ Documentation: Start with the specific guide's README
- ๐ Issues: GitHub Issues for bugs and questions
- ๐ฌ Discussions: GitHub Discussions for general questions
| Issue | Solution |
|---|---|
| CDK Bootstrap Failed | Ensure AWS credentials are configured correctly |
| Model Access Denied | Enable specific models in Bedrock console |
| Lambda Timeout | Increase timeout duration in CDK stack |
| CORS Issues | Check API Gateway CORS configuration |
| High Costs | Review resource usage and implement cleanup |
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2024 [Your Name]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software...
- AWS Team for creating Amazon Bedrock
- CDK Community for excellent documentation and examples
- Contributors who help improve these guides
- Open Source Community for inspiration and best practices
Choose your first guide and start building with Amazon Bedrock today!
Beginner? โ Start with 01-fundamentals
Want to generate images? โ Jump to 02-image-generation
Interested in embeddings? โ Try 04-generate-embedding
Happy Learning! ๐โจ
If you find this repository helpful, please consider giving it a star โญ and sharing it with others who might benefit from these hands-on guides.