Skip to content

ars-devsecops/aws-cost-optimization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’° aws-cost-optimization

Scripts, strategies, and guides for reducing AWS spend β€” by @ars-devsecops

Real result: ~20% AWS monthly cost reduction across client accounts at Flentas Technologies


πŸ“¦ Contents

Path Description
scripts/ec2_rightsizing.py Analyzes EC2 CPU metrics β€” flags over-provisioned instances
savings-plans/savings-plans-strategy.md Framework for Savings Plans & Reserved Instance decisions
reports/ Sample cost reports (anonymized)

πŸš€ Quick Start

# Install dependencies
pip install boto3

# Configure AWS credentials
aws configure

# Run right-sizing analysis (14-day lookback)
python3 scripts/ec2_rightsizing.py --region ap-south-1 --days 14

# Save results to CSV
python3 scripts/ec2_rightsizing.py --region ap-south-1 --days 30 --output report.csv

Sample Output

==========================================================================================
  EC2 RIGHT-SIZING REPORT  |  15 instances analyzed  |  Potential monthly saving: $340
==========================================================================================
Instance ID            Name                 Type           Avg CPU  Max CPU  Suggested       Saving/mo
------------------------------------------------------------------------------------------
i-0abc123def456789a    prod-api-server-01   m5.2xlarge      12.3%   38.1%   m5.xlarge          $140
i-0abc123def456789b    prod-worker-02       m5.xlarge        8.7%   22.4%   m5.large            $70
i-0abc123def456789c    staging-app-01       t3.large         6.1%   15.2%   t3.medium           $34
==========================================================================================
  πŸ“‰ Instances to downsize:   8
  πŸ’° Total potential saving:  $340/month  ($4,080/year)
==========================================================================================

πŸ’‘ Cost Reduction Strategies Used

Strategy Typical Saving
Right-size over-provisioned EC2 20–40% on affected instances
Convert On-Demand β†’ Savings Plans 30–60% on covered usage
Stop dev/test outside business hours ~65% on those instances
Delete unattached EBS volumes Varies
S3 Intelligent-Tiering 20–40% on storage costs
Reduce CloudWatch log retention Varies

🀝 Author

Amol Shinde Β· Cloud & DevOps Engineer Β· Pune, India
LinkedIn

About

This repository contains Scripts + strategies for right-sizing, Savings Plan

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages