Kenta Infrastructure Planner
Self-Service Multi-Tenant IaC Platform with React Portal
The Challenge
Manual infrastructure provisioning was creating bottlenecks for development teams. Each new customer environment required DevOps engineers to manually configure Azure resources, coordinate Terraform deployments, run Ansible playbooks, and manage dependencies between infrastructure components. This manual process was:
- Time-consuming: 2-3 hours per environment deployment
- Error-prone: Manual steps led to configuration drift
- Non-scalable: DevOps team became a bottleneck
- Difficult to track: No centralized deployment history or audit logs
- Complex dependencies: Portainer required before application deployments
The goal was to create a self-service platform that would enable developers to provision complete Azure environments through a web interface while maintaining customer isolation, enforcing dependencies, and providing full deployment visibility.
Solution Architecture
Multi-Tier Platform Design
Built a comprehensive full-stack IaC platform with three integrated layers:
1. React Frontend Portal
Self-service web interface for deployment management with real-time status tracking, deployment history, and intelligent form validation.
- Dynamic customer name and subscription ID validation
- Automatic resource naming preview (environment-specific)
- Dependency enforcement (Portainer-first pattern)
- Real-time deployment status and log streaming
- Deployment history with Terraform outputs
2. FastAPI Backend
RESTful API orchestrating Terraform and Ansible execution with background task processing and state management.
- Background task queue for long-running deployments
- SQLite database for deployment tracking and audit logs
- Input validation and dependency checks
- Terraform output parsing and state inspection
- Error handling with detailed logging
3. IaC Automation Layer
Modular Terraform stacks with Ansible post-provisioning and DRY principles through remote state management.
- Shared provider configuration via symlinks (DRY)
- Remote state for cross-stack dependencies
- Modular stacks: Portainer, SQL Server, applications
- Ansible dynamic inventory generated by Terraform
- Environment-specific naming conventions
Key Architectural Patterns
Customer-specific resource groups and naming
Portainer-first enforcement via API validation
Remote backend for Terraform state sharing
Background tasks for long-running operations
Technical Implementation
React Frontend
- Component Architecture: Separated concerns with dedicated components for deployment forms, history tables, and status displays
- State Management: React hooks for form state, validation, and API integration via Axios
- Dynamic Validation: Client-side GUID validation for subscription IDs, unique customer name checks, and dependency validation
- Real-time Updates: Polling mechanism for deployment status and log streaming
- Responsive Design: Mobile-friendly interface with accessibility considerations
FastAPI Backend
- RESTful API Design: OpenAPI-documented endpoints for deployments, environments, and status queries
- Background Tasks: FastAPI BackgroundTasks for non-blocking Terraform/Ansible execution
- Database Layer: SQLAlchemy ORM with SQLite for deployment tracking and state persistence
- Process Orchestration: Python subprocess management for Terraform CLI and Ansible playbooks
- Error Handling: Comprehensive exception handling with structured logging
- Validation Logic: Pydantic models for request validation and response serialization
Terraform & Ansible
- Modular Stacks: Separate directories for portainer/, sqlserver/, with shared provider configuration
- DRY Principle: Symlinked provider.tf from deploy/common/ to avoid duplication
- Remote State: Azure Storage backend for Terraform state with locking support
- Dynamic Inventory: Terraform outputs generate Ansible inventory files automatically
- Post-Provisioning: Ansible playbooks for Docker installation, Portainer setup, and application configuration
- Variable Management: Environment-specific .tfvars files with sensitive data via environment variables
CI/CD & Deployment
- Azure DevOps Pipelines: YAML-based pipelines for automated provisioning and configuration
- Docker Containerization: All services (frontend, backend) containerized for consistent deployment
- Nginx Reverse Proxy: Frontend served via Nginx with backend proxying
- Documentation: MkDocs-powered documentation with Terraform and Ansible guides
Key Features
Self-Service Deployments
Developers can provision complete Azure environments through an intuitive web interface without DevOps intervention
Dependency Enforcement
Automatic validation ensures Portainer is deployed before dependent applications, preventing configuration errors
Multi-Tenant Architecture
Customer isolation via resource groups and naming conventions ensures secure, scalable multi-tenancy
Deployment Tracking
Complete audit trail with status, logs, Terraform outputs, and deployment history for compliance
Real-Time Status
Live deployment status updates with streaming logs provide visibility into long-running operations
Modular IaC
DRY Terraform stacks with remote state enable easy addition of new infrastructure types and applications
Impact & Results
Technology Stack
Frontend
- • React 18.2 with Hooks
- • Axios for API communication
- • React Testing Library & Jest
- • Nginx (production)
- • Docker containerization
Backend
- • FastAPI 0.104 (Python)
- • Pydantic 2.5 for validation
- • SQLAlchemy 1.4 + SQLite
- • Uvicorn ASGI server
- • Python-dotenv for config
Infrastructure
- • Terraform (Azure provider)
- • Ansible for post-provisioning
- • Azure: VMs, SQL, networking
- • Azure Storage (remote state)
- • Portainer for container management
DevOps
- • Azure DevOps Pipelines
- • Docker & Docker Compose
- • MkDocs for documentation
- • Git version control
- • YAML pipeline definitions
Technical Highlights
Full-Stack Development
Designed and implemented complete application stack from React UI to FastAPI backend, demonstrating proficiency in modern web technologies and API design patterns.
Infrastructure as Code Expertise
Applied DRY principles and modular architecture to Terraform, with remote state management for cross-stack dependencies and Ansible integration for comprehensive automation.
Multi-Tenant SaaS Patterns
Implemented customer isolation, dependency management, and audit logging patterns essential for production SaaS platforms.
DevOps Pipeline Integration
Created Azure DevOps pipelines for automated infrastructure provisioning, demonstrating CI/CD expertise for infrastructure workflows.