Skip to content

πŸš€ Simple AWS Lambda project to clean up unused EBS snapshots & cut storage costs automatically πŸ’Έ

Notifications You must be signed in to change notification settings

RoshanKumar770/Cost-Optimization-EBS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ§ΉπŸ’Έ AWS Lambda: Unused EBS Snapshot Cleanup (Cost Optimization Project) πŸ’ΈπŸ§Ή

Automated AWS Lambda function that identifies and deletes unused, orphaned, or outdated EBS snapshots to help reduce your AWS bill and keep your infrastructure clean 🧼.


πŸš€ Features

βœ… Deletes EBS snapshots that are:

  • πŸ“€ Not attached to any volume
  • πŸ”Œ Taken from volumes not connected to any running EC2 instance
  • πŸ—‘οΈ Linked to deleted volumes

πŸ“Š Logs every action into CloudWatch Logs for traceability
πŸ” Uses least privilege IAM role
🧠 Written in Python using boto3

πŸ’‘ Currently manually triggered from the AWS Lambda Console (EventBridge integration optional)


πŸ› οΈ Technologies Used

Service / Tool Purpose
☁️ AWS Lambda Serverless compute environment
πŸ’½ EBS Snapshots Identified and cleaned up
πŸ–₯️ EC2 Instances Checked for volume attachments
πŸ” IAM Roles Secure, scoped access permissions
πŸ“¦ boto3 SDK Python AWS SDK to interact with AWS
πŸ“Š CloudWatch Logs Audit + Debugging

🧠 Architecture

πŸ§‘β€πŸ’» Manual Trigger (via AWS Lambda Console or CLI) | β–Ό 🧠 AWS Lambda Function (Python + boto3 logic) | β–Ό πŸ“¦ EC2 API Calls: β”œβ”€ πŸ–₯️ describe_instances β”œβ”€ πŸ’½ describe_volumes β”œβ”€ 🧾 describe_snapshots └─ ❌ delete_snapshot (if conditions met) | β–Ό πŸ“Š CloudWatch Logs: └─ πŸ“ Logs all deletions and errors for audit/debug

About

πŸš€ Simple AWS Lambda project to clean up unused EBS snapshots & cut storage costs automatically πŸ’Έ

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages