A progressive AWS kata for building a serverless semantic photo pipeline, from a stubbed S3-triggered Lambda to a searchable image gallery.
main: learner branch with staged stubs, placeholders, and kata instructionssolution: completed reference implementation, including the App Runner gallery frontend
If you want to do the exercise, stay on main.
If you want the finished reference, inspect solution.
Completed solution branch frontend preview.
Core pipeline:
- A user uploads a photo to S3
- S3 triggers the ingest Lambda
- Lambda calls Rekognition for visual labels
- Lambda calls Bedrock (Titan Embed) to generate a 1024-dimension vector
- Metadata is written to DynamoDB and indexed in OpenSearch Serverless
- A search Lambda behind API Gateway accepts natural-language queries and returns semantically ranked results
Reference solution extras on solution:
- An App Runner gallery frontend
- Browser upload flow
- Text search and image-based search
- Indexed image count and presigned image URLs
This kata currently uses OpenSearch Serverless for vector search. That is convenient for the exercise, but expensive for casual experimentation.
COSTS.md currently estimates the default stack at roughly $700/month idle, mostly from AOSS capacity.
Do not run make deploy until you have read COSTS.md and decided that cost is acceptable for your use case.
| Tool | Version | Purpose |
|---|---|---|
| Terraform | >= 1.3 | Infrastructure provisioning |
| Python | 3.12 | Lambda runtime and local tooling |
| uv | latest | Python dependency management |
| AWS CLI | v2 | Credentials, log tailing |
AWS credentials must be configured with permissions for Lambda, S3, IAM, Rekognition, Bedrock, DynamoDB, OpenSearch Serverless, API Gateway, and App Runner if you plan to use the solution frontend.
For the kata path on main:
make install
make setupThen work through KATA.md stage by stage.
For the completed flow on solution:
make install
make deploy
make upload
make search QUERY=beach
make smoke-frontend
make destroymain teaches the pipeline in 7 core stages:
| # | Title | New Service |
|---|---|---|
| 1 | S3 -> Lambda hello | S3, Lambda |
| 2 | Rekognition labels | Rekognition |
| 3 | DynamoDB metadata | DynamoDB |
| 4 | Bedrock embeddings | Bedrock |
| 5 | OpenSearch indexing | OpenSearch Serverless |
| 6 | Search Lambda + APIGW | API Gateway |
| 7 | IaC polish + e2e | Consolidation |
The solution branch additionally includes a frontend stage built on App Runner.
KATA.md: full stage-by-stage exerciseCOSTS.md: cost analysis and cheaper alternativesdocs/architecture.md: visual overview of the completed solution branchdocs/terraform-modules.md: generated module graph fromterraform/main.tfterraform/: infrastructure moduleslambdas/: ingest and search handlersapp/: gallery frontend used by thesolutionbranch
