This repository is a sandbox project for experimenting with Domain-Driven Design (DDD) principles using a FastAPI application across multiple cloud platforms.
It comes with Terraform setups for GCP, AWS, and Azure, deployed through GitHub Actions pipelines.
It simulates managing paper product inventory, sales personnel, and sales transactions — inspired by Dunder Mifflin.
Domain-Driven Design architecture with FastAPI
Containerization with Docker
- ☁️ Multi-cloud deployment targets ☁️
Infrastructure as Code via Terraform
Automated CI/CD using GitHub Actions (Terraform validation + deployment)
Ensure the following tools are installed:
- Python
- Google Cloud Platform (GCP)
- Amazon Web Services (AWS)
- Microsft Azure (Azure)
- Docker
- Terraform
# Clone repository
git clone git@github.com:mel-cdn/aws-gcp-azure-terraform-fastapi.git
cd aws-gcp-azure-terraform-fastapi
# Install Pipenv
pip install pipenv==2025.0.4
# Activate Pipenv environment
pipenv shell
# Install dependencies
./run-pip-updates.sh
# Run locally
./run-local-service.sh
# Run pytest with coverage
./run-unit-tests-with-coverage.sh
Heads up — this service might be unavailable because I paused it to save on costs (since App Runner doesn’t support 0-minimum instance scaling, haha! 🙂)
- App Runner: https://xzmd8mftmp.ap-southeast-1.awsapprunner.com/swagger
- Domain Mapped: https://api.dminventory.aws.melcadano.com/swagger
- Cloud Run: https://dm-inventory-api-6jqimisapa-de.a.run.app/swagger
- Domain Mapped: https://api.dminventory.gcp.melcadano.com/swagger
- Container App: https://playground-dm-inventory-prod-aca.proudwave-14ef48de.southeastasia.azurecontainerapps.io/swagger
- Domain Mapped: https://api-dminventory-azure.melcadano.com/swagger
Dashes, because Azure does not support multi-level sub-domain for binding_type = "SniEnabled" 🙂
- Initial setup of FastAPI project
- Make
PaperProduct
a nested object ofProduct
- Add
Salesman
andSales
entities - Integrate real database: S3 (AWS)
- Integrate real database: Cloud Storage (GCP)
- Integrate real database: Azure Storage (Azure)
- Terraform deployment with GCS backend
- Setup GitHub Actions deployment pipeline
- Automated deployment to
prod
environment - Map service to a domain name
- Update GitHub Pipeline to use OIDC instead of Service Account Key
- Terraform deployment with S3 backend
- Setup GitHub Actions deployment pipeline
- Automated deployment to
prod
environment - Map service to a domain name
- Update GitHub Pipeline to use OIDC instead AWS Keys
- Terraform deployment with backend
- Setup GitHub Actions deployment pipeline
- Automated deployment to
prod
environment - Map service to a domain name