Skip to content

About

End-to-End Multi-Stack DevOps Project: AWS + Terraform + Ansible + Docker Microservices Voting App (Python, Node.js, .NET, Redis, Postgres)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Multi-Stack DevOps Voting Application on AWS

AWS Terraform Ansible Docker Networking

Python Node.js .NET Redis PostgreSQL GitHub


πŸ“– Overview

This project demonstrates a complete end-to-end DevOps workflow by deploying a polyglot microservices voting application on AWS.

Users vote between Cats 🐱 and Dogs 🐢. The system processes votes asynchronously and displays real-time results.

The application is intentionally multi-language and multi-framework to showcase real-world polyglot infrastructure skills:

Service Language / Framework Role
Vote Python + Flask Frontend – accept votes
Result Node.js + Express Frontend – display live results
Worker C# / .NET Background worker
Redis Redis In-memory message queue
Postgres PostgreSQL Persistent data store

Infrastructure is fully managed as code using Terraform.
Configuration & deployment are automated with Ansible.
All application components run as Docker containers.

Goal: Production-style multi-tier architecture on AWS with proper networking, security groups, bastion host, and remote state management β€” ready for a professional GitHub portfolio.


πŸ—οΈ Architecture

High-Level AWS Architecture

AWS Architecture

Key Components:

  • VPC with Public and Private Subnets
  • Bastion / Frontend EC2 (Public Subnet) – Vote + Result services + Jump Host
  • Backend EC2 (Private Subnet) – Redis + Worker
  • Database EC2 (Private Subnet) – PostgreSQL
  • NAT Gateway – Outbound internet access for private instances
  • Security Groups – Least-privilege rules between tiers
  • Terraform Remote State – S3 + DynamoDB locking

Application Data Flow

App Architecture

User β†’ Vote (Python) β†’ Redis ← Worker (.NET) β†’ PostgreSQL ← Result (Node.js) β†’ User

πŸ› οΈ Technology Stack

Category Tools / Services
Cloud Provider Amazon Web Services (AWS)
Infrastructure as Code Terraform
Configuration Management Ansible
Containerization Docker & Docker Compose
Networking VPC, Subnets, Route Tables, NAT Gateway, Security Groups, Bastion Host
Application Stack Python (Flask), Node.js (Express), .NET Worker
Data Stores Redis (queue), PostgreSQL (persistence)
CI / State Terraform Remote Backend (S3 + DynamoDB)
Version Control Git + GitHub

✨ Key Features

  • βœ… Multi-tier AWS architecture (Public + Private subnets)
  • βœ… Infrastructure provisioned entirely with Terraform
  • βœ… Configuration management & container deployment with Ansible
  • βœ… Bastion host pattern for secure access to private instances
  • βœ… Least-privilege Security Groups
  • βœ… Dockerized polyglot microservices
  • βœ… Redis as message queue + PostgreSQL for persistence
  • βœ… Real-time voting results via WebSockets
  • βœ… Remote Terraform state with locking
  • βœ… Portfolio-ready documentation and architecture diagrams

πŸ“ Project Structure

.
β”œβ”€β”€ terraform/                  # Infrastructure as Code
β”‚   β”œβ”€β”€ main.tf
β”‚   β”œβ”€β”€ variables.tf
β”‚   β”œβ”€β”€ outputs.tf
β”‚   β”œβ”€β”€ vpc.tf
β”‚   β”œβ”€β”€ ec2.tf
β”‚   β”œβ”€β”€ security_groups.tf
β”‚   β”œβ”€β”€ backend.tf              # S3 + DynamoDB remote state
β”‚   └── ...
β”œβ”€β”€ ansible/                    # Configuration Management
β”‚   β”œβ”€β”€ inventory/
β”‚   β”œβ”€β”€ group_vars/
β”‚   β”œβ”€β”€ playbooks/
β”‚   β”‚   β”œβ”€β”€ site.yml
β”‚   β”‚   β”œβ”€β”€ install_docker.yml
β”‚   β”‚   └── deploy_containers.yml
β”‚   └── roles/
β”‚       β”œβ”€β”€ docker_install/
β”‚       β”œβ”€β”€ deploy_containers/
β”‚       └── postgres_persist/
β”œβ”€β”€ app/                        # Application source (or Docker images from Docker Hub)
β”‚   β”œβ”€β”€ vote/
β”‚   β”œβ”€β”€ result/
β”‚   └── worker/
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ architecture.png
β”‚   └── app-architecture.jpg
β”œβ”€β”€ docker-compose.yml          # Local development
└── README.md

πŸš€ Getting Started

Prerequisites

  • AWS Account with appropriate IAM permissions
  • Terraform β‰₯ 1.5
  • Ansible β‰₯ 2.14
  • Docker & Docker Compose
  • AWS CLI configured (aws configure)
  • SSH key pair for EC2 access

1. Clone the Repository

git clone https://github.com/<your-username>/multi-stack-devops-voting-app.git
cd multi-stack-devops-voting-app

2. Provision Infrastructure (Terraform)

cd terraform
terraform init
terraform plan
terraform apply

This creates:

  • VPC + Public/Private Subnets
  • NAT Gateway
  • 3 EC2 instances (Frontend/Bastion, Backend, Database)
  • Security Groups
  • Remote state backend (S3 + DynamoDB)

3. Configure Instances (Ansible)

Update inventory with private IPs / hostnames and configure SSH ProxyJump via the bastion.

cd ../ansible
ansible-playbook -i inventory/hosts playbooks/site.yml

The playbooks will:

  1. Install & configure Docker
  2. Pull images from Docker Hub
  3. Deploy containers with correct environment variables
  4. Persist PostgreSQL data on a volume

4. Access the Application

  • Vote UI: http://<FRONTEND_PUBLIC_IP>:8080
  • Result UI: http://<FRONTEND_PUBLIC_IP>:8081

Cast votes and watch results update in real time.


πŸ” Security Highlights

  • Private subnets for Redis, Worker, and PostgreSQL (no direct internet exposure)
  • Bastion host pattern for SSH access
  • Security Groups enforce least privilege:
    • Frontend SG β†’ Internet (HTTP)
    • Backend SG β†’ Accept Redis traffic only from Frontend
    • DB SG β†’ Accept Postgres traffic only from Worker/Backend
  • Terraform remote state stored securely in S3 with DynamoDB locking
  • No secrets committed to Git (use environment variables / Ansible Vault)

πŸ§ͺ Local Development (Optional)

docker compose up --build

Access:


πŸ“Έ Demo & Presentation

This project is designed for a 15-minute portfolio presentation covering:

  1. Terraform plan & infrastructure walkthrough
  2. Ansible playbooks & roles
  3. Live demo of voting + real-time results
  4. Architecture diagram explanation
  5. Security group & networking decisions

🧠 What I Build

  • Designing multi-tier VPC architectures (public/private subnets, NAT, route tables)
  • Writing production-grade Terraform modules and remote state
  • Using Ansible with jump hosts / ProxyJump for private instances
  • Container networking across multiple EC2 hosts
  • Least-privilege security group design
  • Orchestrating polyglot microservices (Python, Node.js, .NET)
  • End-to-end Infrastructure-as-Code + Configuration-as-Code workflow

πŸ‘€ Author

**Penchalaiah Jammula **

LinkedIn GitHub Portfolio


πŸ“„ License

This project is for portfolio purposes.
Original application inspired by the Docker Sample Voting App.


Built with ❀️ for DevOps Portfolio
AWS Β· Terraform Β· Ansible Β· Docker Β· Networking

About

End-to-End Multi-Stack DevOps Project: AWS + Terraform + Ansible + Docker Microservices Voting App (Python, Node.js, .NET, Redis, Postgres)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages