Skip to content

Parshant1231/cloud-native-devops-platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

☁️ Cloud-Native DevOps Deployment Platform


AWS Terraform Docker GitHub Actions Nginx


πŸš€ Project Overview

This project demonstrates a production-style cloud-native deployment pipeline built using modern DevOps principles.

It automates:

  • Infrastructure provisioning (Infrastructure as Code)
  • Containerized application deployment
  • CI/CD pipeline execution
  • Reverse proxy configuration
  • Secure remote deployment to AWS

The goal is to simulate a real-world enterprise deployment workflow.


πŸ—οΈ Architecture Flow

graph TD
    Developer((fa:fa-code Developer))
    GitHub["fa:fa-github GitHub Repository"]
    
    subgraph GH_Actions [GitHub Actions CI/CD]
        Build["fa:fa-hammer Build Docker Image"]
        DockerPush["fa:fa-docker Push to DockerHub"]
    end

    DockerHub["fa:fa-box DockerHub Registry"]

    subgraph AWS_Cloud [AWS EC2 Infrastructure]
        Terraform["fa:fa-cloud Terraform Provisioning"]
        
        subgraph Instance [EC2 Instance]
            Nginx["fa:fa-server Nginx Reverse Proxy"]
            DockerRun["fa:fa-container Docker Runtime"]
        end
    end

    LiveApp((fa:fa-globe Live Production App))

    Developer -- "git push" --> GitHub
    GitHub --> Build
    Build --> DockerPush
    DockerPush -. "kanvit279/devops-app" .-> DockerHub
    DockerHub -- "docker pull" --> DockerRun
    Terraform -- "IaC" --> AWS_Cloud
    Nginx -- "Proxy (80 -> 3000)" --> DockerRun
    LiveApp --- Nginx
Loading

⚑ Technology Ecosystem

☁️ Cloud Layer πŸ—οΈ Infrastructure 🐳 Container

AWS EC2
Elastic Compute Cloud

Terraform
Infrastructure as Code

Docker
Container Runtime

Security Groups
Network Firewall

HCL
Hashicorp Config

Compose
Multi-Container

IAM
Identity & Access

State Mgmt
Remote Backend

Registry
Image Repository
πŸ”„ CI/CD 🌐 Reverse Proxy πŸ’» Backend πŸ–₯ OS

GitHub Actions
Automation Engine

Nginx
Load Balancer

Node.js
JavaScript Runtime

Ubuntu
Linux OS

Auto Deploy
Continuous Delivery

Reverse Proxy
Request Routing

Express
Web Framework

Bash/Zsh
Shell Environment

Testing
Quality Gates

SSL/TLS
Secure Transport

NPM
Package Manager

Systemd
Service Manager

☁️ 3 Cloud Services πŸ—οΈ 3 IaC Components 🐳 3 Container Tools πŸ”„ 3 CI/CD Stages



πŸ“¦ Project Architecture

Modular Directory Structure

Clean separation of concerns for maintainable infrastructure


πŸš€ Click to explore the architecture
πŸ“¦ cloud-native-devops-platform
β”œβ”€β”€ πŸ“‚ .github                          # GitHub Configuration Hub
β”‚   └── πŸ“‚ workflows
β”‚       └── πŸ“œ deploy.yml                # ⚑ CI/CD Automation Engine
β”‚                                          └── Triggers: push, PR to main
β”‚
β”œβ”€β”€ πŸ“‚ app                               # 🎯 Application Core
β”‚   β”œβ”€β”€ πŸ“œ index.js                       # 🧠 Node.js Core Logic
β”‚   β”‚                                       β”œβ”€β”€ Express server
β”‚   β”‚                                       β”œβ”€β”€ Health endpoints
β”‚   β”‚                                       └── API routes
β”‚   β”œβ”€β”€ πŸ“œ package.json                    # πŸ“¦ Dependency Manifest
β”‚   β”‚                                       β”œβ”€β”€ Scripts
β”‚   β”‚                                       β”œβ”€β”€ Dependencies
β”‚   β”‚                                       └── Metadata
β”‚   └── πŸ“œ Dockerfile                       # 🐳 Container Blueprint
β”‚                                              β”œβ”€β”€ Multi-stage build
β”‚                                              β”œβ”€β”€ Production optimization
β”‚                                              └── Security hardening
β”‚
β”œβ”€β”€ πŸ“‚ terraform                          # πŸ—οΈ Infrastructure as Code
β”‚   β”œβ”€β”€ πŸ“œ main.tf                          # πŸ›οΈ Infrastructure Definition
β”‚   β”‚                                          β”œβ”€β”€ EC2 instances
β”‚   β”‚                                          β”œβ”€β”€ Security groups
β”‚   β”‚                                          └── IAM roles
β”‚   β”œβ”€β”€ πŸ“œ variables.tf                      # βš™οΈ Environment Variables
β”‚   β”‚                                          β”œβ”€β”€ Instance types
β”‚   β”‚                                          β”œβ”€β”€ Region config
β”‚   β”‚                                          └── Key pairs
β”‚   └── πŸ“œ outputs.tf                        # πŸ“ Resource Mapping
β”‚                                              β”œβ”€β”€ Public IPs
β”‚                                              β”œβ”€β”€ DNS names
β”‚                                              └── Instance IDs
β”‚
β”œβ”€β”€ πŸ“‚ nginx                              # 🌐 Reverse Proxy Layer
β”‚   └── πŸ“œ default.conf                     # πŸ”€ Proxy Rules
β”‚                                              β”œβ”€β”€ Load balancing
β”‚                                              β”œβ”€β”€ SSL termination
β”‚                                              └── Request routing
β”‚
└── πŸ“œ README.md                          # πŸ“š Project Documentation
                                              β”œβ”€β”€ Setup guide
                                              β”œβ”€β”€ Deployment steps
                                              └── API reference

πŸ”„ End-to-End DevOps Workflow

Automated pipeline from development to production


    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚   πŸ’» DEV     │────▢│   πŸ”„ GITHUB  │────▢│   🐳 DOCKER  │────▢│   ☁️ AWS     β”‚
    β”‚   PUSH       β”‚     β”‚   ACTIONS    β”‚     β”‚   BUILD      β”‚     β”‚   EC2        β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
           β–²                       β–²                      β–²                      β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                    πŸš€ CONTINUOUS DEPLOYMENT PIPELINE
  

⏱️ Deployment Timeline

1
Code Push
0s
2
CI/CD Trigger
5s
3
Docker Build
30s
4
Push to Hub
45s
5
EC2 Deploy
60s

πŸ“‹ Step-by-Step Execution

🎯 Phase 1: Trigger

  1. 01 Developer pushes code to main branch
  2. 02 GitHub Actions detects the push event

πŸ”„ Phase 2: Build

  1. 03 Docker image built from /app directory
  2. 04 Image pushed to DockerHub registry

πŸš€ Phase 3: Deploy

  1. 05 GitHub connects via SSH to AWS EC2 instance
  2. 06 EC2 pulls latest Docker image

βœ… Phase 4: Live

  1. 07 Old container stopped and removed
  2. 08 New container starts with updated code
  3. 09 Nginx routes traffic port 80 β†’ 3000
✨ Application Live β†’ Zero Downtime Deployment Achieved ✨



⚑ CI/CD Pipeline Architecture

Automated GitHub Actions workflow for continuous delivery

πŸ”„ GitHub Actions Pipeline

βœ“
Checkout
β†’
πŸ”‘
Docker Login
β†’
πŸ—οΈ
Build Image
β†’
πŸ“€
Push Image
↓
πŸ”Œ
SSH Connect to EC2
⬇️
Pull Image
πŸ›‘
Stop Old
πŸš€
Deploy New

🎯 Why CI/CD?

🚫 No Manual Work

Eliminates human intervention in deployment process

100% Automated

⚠️ Zero Errors

Reduces human mistakes in production

99.9% Reliable

⚑ Faster Releases

Deploy multiple times per day

2-min cycle



πŸ—οΈ Infrastructure as Code (Terraform)

Version-controlled infrastructure provisioning

πŸ“¦ Terraform Manages

  • βœ… EC2 Instance - t2.micro
  • βœ… Security Group - Ports 22,80,3000
  • βœ… IAM Roles - Permissions
  • βœ… Network Config - VPC setup

🎯 Why Terraform?

πŸ“ Version Control
πŸ”„ Reproducible
🚫 No Manual Console
⚑ Auto Provision
πŸ“Š No Drift

πŸ’» Terraform CLI Commands

The following Terraform commands are used to manage the infrastructure lifecycle:

# Initialize the working directory
terraform init

# Preview infrastructure changes before applying
terraform plan

# Deploy infrastructure
terraform apply -auto-approve

# Destroy all managed infrastructure
terraform destroy

πŸ›οΈ Infrastructure Architecture

    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚                      AWS Cloud                              β”‚
    β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚
    β”‚  β”‚  Security Group (Ports: 22, 80, 3000)               β”‚    β”‚
    β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚    β”‚
    β”‚  β”‚  β”‚  EC2 Instance (t2.micro)                    β”‚    β”‚    β”‚
    β”‚  β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚    β”‚    β”‚
    β”‚  β”‚  β”‚  β”‚  Docker Container                   β”‚    β”‚    β”‚    β”‚
    β”‚  β”‚  β”‚  β”‚  Node.js App on Port 3000           β”‚    β”‚    β”‚    β”‚
    β”‚  β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚    β”‚    β”‚
    β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚    β”‚
    β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  

πŸ”„ Terraform Workflow

1
Write
.tf files
β†’
2
Plan
terraform plan
β†’
3
Apply
terraform apply
β†’
4
Manage
version control

βœ… Fully Automated | πŸ”„ Zero Downtime | πŸ—οΈ Infrastructure as Code | ⚑ CI/CD Enabled

πŸš€ Deployment Workflow

πŸ“¦ Step-by-Step Deployment Guide

1

πŸ—οΈ Provision

Terraform

β†’ 2

βš™οΈ Configure

EC2 Setup

β†’ 3

πŸ“€ Push

Git Commit

β†’ 4

πŸ”„ Deploy

CI/CD

β†’ 5

🌐 Access

Live App



Step 0. Create a key-par (Terraform used)

ssh-keygen -t rsa -b 4096 -f ~/.ssh/key-name
image

Step 1. Clone the Repository

git clone https://github.com/your-username/cloud-native-devops-platform.git
cd cloud-native-devops-platform

Step 2. Setup AWS Credentials (Required for Terraform)

# Install AWS CLI and configure:
aws configure

ℹ️ Provide: AWS Access Key, AWS Secret Key, Region (e.g., ap-south-1)

image

Step-3 Provision Infrastructure

# Navigate to the terraform directory:
cd terraform
terraform init
terraform plan
terraform apply

ℹ️ This creates the EC2 instance and required security groups with ports 22 (SSH), 80 (HTTP), and 3000 (Node.js) open.

image

Step-4 Configure EC2 (One-Time Setup)

# Connect to your EC2 instance
ssh -i your-key-pair.pem ubuntu@<public-ip>
image

Then install Docker and Nginx:

# Update package lists
sudo apt update && sudo apt upgrade -y

# Install Docker
sudo apt install docker.io -y
sudo systemctl start docker
sudo systemctl enable docker
sudo usermod -aG docker $USER  # Add user to docker group

# Install Nginx
sudo apt install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginx

# Verify installations
docker --version
nginx -v

ℹ️ EC2 instance is prepared with all necessary tools for containerization and reverse proxy.

Step-5 Configure Nginx Reverse Proxy

Edit Nginx configuration:

sudo nano /etc/nginx/sites-available/default

Replace with:

server {
    listen 80;

    location / {
        proxy_pass http://localhost:3000;
    }
}

Restart nginx. Nginx listen on port 80 and forward all incoming web traffic to your application running on port 3000 inside the server.

image

Step-6 Push Code to GitHub

# Add all changes
git add .

# Commit with a meaningful message
git commit -m "Deploy: Update application with new features"

# Push to main branch (triggers CI/CD)
git push origin main

Step-7 CI/CD Handles Deployment

Before proceeding further, ensure that all required credentials are added under: Repository Settings β†’ Secrets and Variables β†’ Actions.


image

Step-8 Workflows Status

If it appears like this, it means everything is configured correctly.

image

Website View

image

πŸ“ˆ Future Improvements & Scalability

This project can be extended with:

  • Auto Scaling Groups for horizontal scaling
  • Application Load Balancer for high availability
  • HTTPS configuration using SSL certificates
  • Blue-Green or Rolling deployments
  • Monitoring stack (Prometheus + Grafana)
  • Centralized logging
  • Kubernetes-based deployment

These enhancements would make the system production-grade at enterprise level.

πŸ’° Cost Management

To avoid unnecessary AWS charges:

terraform destroy

πŸ“Š Monitoring & Observability

  • EC2 metrics monitored via CloudWatch
  • CPU and memory usage can be tracked
  • Docker container status verified using docker ps
  • Logs accessible using docker logs

Monitoring ensures application health and availability.

🎯 Conclusion

This project demonstrates a complete DevOps production workflow, including infrastructure provisioning, containerization, CI/CD automation, and secure cloud deployment.

It reflects real-world engineering practices used in modern cloud-native environments.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors