Automated tooling to reduce cloud spend for GistPin infrastructure.
| Script | Purpose |
|---|---|
infrastructure/scripts/optimize-costs.sh |
Orchestrates all cost checks and produces a JSON report |
infrastructure/scripts/find-idle-resources.sh |
Detects idle k8s pods, scaled-down deployments, unbound PVCs, and idle EC2 instances |
# Run full cost optimisation analysis
bash infrastructure/scripts/optimize-costs.sh
# Scan for idle resources only
bash infrastructure/scripts/find-idle-resources.shReports are written to infrastructure/reports/cost/cost-report-<timestamp>.json.
| Variable | Default | Description |
|---|---|---|
REPORT_DIR |
infrastructure/reports/cost |
Output directory for reports |
IDLE_CPU_THRESHOLD |
5 |
CPU % below which a resource is considered idle |
IDLE_MEM_THRESHOLD |
10 |
Memory % below which a resource is considered idle |
ENVIRONMENT |
unknown |
Label written into the report |
jq— JSON processingkubectl+ metrics-server — for Kubernetes checks (optional)- AWS CLI with
ce:GetReservationCoveragepermission — for RI analysis (optional)
- Run
optimize-costs.shon a schedule (e.g. weekly cron). - Review the generated report and the idle-resource output.
- Right-size or terminate identified resources.
- Re-run to confirm savings.