Commit 944cbda
committed
Add automated EC2 cleanup and reduce workflow parallelism
Changes:
- Add EC2 cleanup step in workflow to terminate orphaned test instances
- Reduce max-parallel from 9 to 5 for both test jobs (cost optimization)
- Add cleanup Lambda module for daily automated cleanup (safety net)
- Add comprehensive documentation for EC2 cleanup strategy
Workflow improvements:
- Cleanup runs before terraform destroy with if: always()
- Terminates instances matching test patterns immediately
- Reduces cost from long-running orphaned instances
Cost optimization:
- Lower parallelism reduces simultaneous instance count
- Immediate cleanup prevents instances running for hours
- Lambda provides backup cleanup at 1 AM UTC daily
Documentation:
- EC2_CLEANUP_PLAN.md: Multi-layer cleanup strategy
- IAM_SECURITY_INVESTIGATION.md: IAM security analysis
- modules/cleanup/: Complete Terraform module for Lambda cleanup1 parent ded1ec6 commit 944cbda
File tree
7 files changed
+2031
-3
lines changed- .github/workflows
- infra/aws/terraform/modules/cleanup
7 files changed
+2031
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
328 | | - | |
| 328 | + | |
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| |||
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
520 | | - | |
| 520 | + | |
521 | 521 | | |
522 | 522 | | |
523 | 523 | | |
| |||
807 | 807 | | |
808 | 808 | | |
809 | 809 | | |
810 | | - | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
811 | 844 | | |
812 | 845 | | |
813 | 846 | | |
| |||
0 commit comments