Project · AWS-Jenkins-Instance

AWS Ephemeral Jenkins — High-Level Design

Run Jenkins cheaply: destroy it nightly to stop billing, restore it next day with no data loss. Achieved by separating disposable **compute** from a snapshotted **data volume**.

type hldstatus activeaws · jenkins · architecture

Architecture

flowchart LR
  TF["terraform apply"] --> Q{"latest snapshot?"}
  Q -- yes --> VOL["EBS data volume (restored, encrypted)"]
  Q -- no --> VOL2["fresh 20 GB EBS"]
  VOL --> EC2["EC2 t3.medium"]
  VOL2 --> EC2
  EC2 --> UD["user_data: mount · fix owner · patch Jenkins IP"]
  UD --> JEN["Jenkins (Java)"]
  DEST["terraform destroy"] --> BK["snapshot data volume → keep 3 newest"]

Components

EC2 t3.medium (disposable compute) · 20 GB EBS data volume (state) · EBS snapshots (backups) · bash user_data bootstrap.

Decisions (from the project)

  • Split state from compute so the instance can be destroyed/recreated freely.
  • Snapshot-on-destroy + restore-on-apply gives a "save / load" loop with retention of 3.
  • /dev/urandom + capped heap keep a headless JVM stable and fast.
Compiled from wiki/projects/AWS-Jenkins-Instance/HLD.md · git is the source of truth