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.
Related
Compiled from
wiki/projects/AWS-Jenkins-Instance/HLD.md · git is the source of truth