Skip to content

parth-ranalkar/aws-cost-optimization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

AWS Cloud Cost Optimization - Identifying Stale Resources

Identifying Stale EBS Snapshots

In this project, I've developed a Lambda function that proactively identifies and deletes EBS snapshots no longer associated with any active EC2 instances. This automated process helps save on storage costs by ensuring that unused snapshots are efficiently cleaned up.

Description:

The Lambda function fetches all EBS snapshots owned by the same account ('self') and also retrieves a list of active EC2 instances (running and stopped). For each snapshot, it checks if the associated volume (if exists) is not associated with any active instance. If it finds a stale snapshot, it deletes it, effectively optimizing storage costs.

Screenshots:

  • Created EC2 Instance on AWS

    1

Note

Already there was one EC2 instance I created earlier , That's why it's showing 2 instances.

2

  • Took snapshot of EC2

    3

  • Terminated EC2

    4

  • Stale Snapshot Count

Note

After terminating EC2 the snapshot is still there on AWS.

5

  • After Running AWS Lambda Function

6

Releases

No releases published

Packages

No packages published

Languages