Skip to content

awab-hassan/07-pythonProject-DEVOPS

Repository files navigation

Python Discord Chat Exporter — AWS ECS Deployment

Python Docker AWS ECS S3 Discord

Overview

Developed a Python application that reads a JSON file containing Discord channel IDs, exports chat history from each channel, and securely uploads the exported data to an Amazon S3 bucket. The application was Dockerized, pushed to DockerHub, and deployed on AWS ECS with a Load Balancer and properly configured security groups.

Architecture

Architecture Diagram

The deployment flow:

  • Python app reads a JSON input file → extracts Discord channel IDs → exports chat history
  • Docker image built and pushed to DockerHub
  • AWS ECS runs the containerized application via Task Definition and Service
  • Load Balancer routes traffic with security group controls
  • Amazon S3 stores the exported Discord chat data securely

Tech Stack

Layer Technology
Language Python
Containerisation Docker + DockerHub
Container orchestration AWS ECS
Storage Amazon S3
Load balancing AWS Application Load Balancer
Security AWS Security Groups
Input JSON file (channel IDs)

What Was Built

1. Python Discord chat exporter

  • Reads a JSON input file containing Discord channel IDs
  • Connects to Discord API and exports full chat history per channel
  • Uploads exported data directly to Amazon S3

2. Dockerized and pushed to DockerHub

  • Wrote a Dockerfile packaging the Python application
  • Built and pushed the image to a DockerHub repository for use in ECS

3. AWS Security Groups

  • Configured security group for the Python application container
  • Configured separate security group for the Load Balancer
  • Restricted inbound/outbound rules to only necessary ports

4. AWS ECS Deployment

  • Deployed an ECS cluster
  • Created a Task Definition matching the application's resource requirements
  • Deployed the task in an ECS Service for managed execution

5. Demo delivered

  • Demonstrated the full flow to the client: JSON input → Discord export → S3 upload

Project Structure

07-pythonProject-DEVOPS/
├── app/
│   ├── main.py           (Discord export + S3 upload logic)
│   └── channels.json     (Input: Discord channel IDs)
├── Dockerfile
└── README.md

Key Learnings

  • Building a Python application that integrates Discord API with AWS S3 in a single workflow
  • Configuring ECS Task Definitions with the right memory, CPU, and environment variables
  • Separating security groups for the application and load balancer layers — least privilege access

About

Python script that exports Discord chat history from JSON-defined channel IDs and uploads to Amazon S3 — Dockerized and deployed on AWS ECS with Load Balancer and security groups.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages