← maksympatrushev.com

Case study · DevOps

SunBot → AWS, as code

I took a live production Discord bot (35+ servers, 90k+ member reach) and rebuilt its environment as a reproducible AWS stack defined entirely in Terraform — provisioned from scratch with a single terraform apply.

Terraform AWS Docker Linux

The problem

Approach

Built incrementally — every step a working terraform apply I could inspect and tear down, so nothing was a big-bang risk:

Architecture

        AWS eu-central-1 (default VPC)
  you ──SSH(22)──▶ EC2 t3.micro ──MySQL(3306)──▶ RDS MySQL
                  (Docker: bot)                 private, SG-locked
                        │
                        └── off-site dumps ──▶ S3 (versioned)

  AWS Budgets watches spend · all defined in Terraform

Decisions & lessons

What's next

Kubernetes (kind) for orchestration and deeper Grafana/Prometheus dashboards-as-code — extending the same repo.

View the code ↗ See the live bot ↗