Skip to content

mel-cdn/aws-gcp-azure-terraform-fastapi

Repository files navigation

Dunder Mifflin Inventory Service

PROD Build Status

📖 Overview

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.

✨ Highlights

  • FastAPI Domain-Driven Design architecture with FastAPI
  • Docker Containerization with Docker
  • ☁️ Multi-cloud deployment targets ☁️
    • GCP Google Cloud Platform (GCP)
    • AWS Amazon Web Services (AWS)
    • Azure Microsoft Azure (Azure)
  • Terraform Infrastructure as Code via Terraform
  • GitHub Actions Automated CI/CD using GitHub Actions (Terraform validation + deployment)

🚀 Getting Started

Prerequisites

Ensure the following tools are installed:


Installation

# 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

Testing

# Run pytest with coverage
./run-unit-tests-with-coverage.sh

🌍 API Deployments

Infrastructure as Code (IaC)

FastAPI Endpoints

AWS Swagger URL

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! 🙂)

GCP Swagger URL

Azure Swagger URL

Dashes, because Azure does not support multi-level sub-domain for binding_type = "SniEnabled" 🙂

🗺️ Roadmap / To-Do

Inventory Service

  • Initial setup of FastAPI project
  • Make PaperProduct a nested object of Product
  • Add Salesman and Sales entities
  • Integrate real database: S3 (AWS)
  • Integrate real database: Cloud Storage (GCP)
  • Integrate real database: Azure Storage (Azure)

Infrastructure (GCP)

  • 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

Infrastructure (AWS)

  • 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

Infrastructure (Azure)

  • Terraform deployment with backend
  • Setup GitHub Actions deployment pipeline
  • Automated deployment to prod environment
  • Map service to a domain name