Serverless Enrichment API
A production-style serverless API built with FastAPI and deployed to AWS Lambda as a container image behind API Gateway. Infrastructure is managed entirely with Terraform to mirror real-world cloud workflows.
AWS Lambda API Gateway Terraform FastAPI Docker
Problem
I wanted to understand how containerized applications actually run in a serverless AWS environment — beyond console demos and zip-based Lambda functions. Many examples stop short of showing how services are wired together in practice.
Approach
- Build a small but realistic FastAPI service with clear request/response behavior.
- Package the application as a Docker image and push it to Amazon ECR.
- Deploy the image to AWS Lambda using container support.
- Expose the service via API Gateway using proxy routing.
- Rebuild the entire setup using Terraform after validating it manually.
Key Decisions
- Use Lambda container images instead of zip-based deployments.
- Keep API Gateway thin and let FastAPI handle all routing.
- Manage IAM, Lambda, and API Gateway entirely with Terraform.
- Add a version endpoint to expose deploy metadata and git SHA.
Results
- Fully working serverless API deployed via Infrastructure as Code.
- Clear understanding of region alignment between AWS services.
- Reusable Terraform patterns for future serverless projects.
- Improved confidence debugging real cloud deployment issues.