Skip to content

Lambda function identifies EBS snapshots that are no longer associated with any active EC2 instance and deletes them to save on storage costs

Notifications You must be signed in to change notification settings

aravindan888/Cost-optimization-AWS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Cost-optimization-AWS

Lambda function identifies EBS snapshots that are no longer associated with any active EC2 instance and deletes them to save on storage costs

By default there is volumes attached to EC2 instance and those volumes are filled with the sensitive data of the org, so a backup is needed where a developer takes snapshots

so when the developer forgets to delete snapshots and deletes the ec2/ volume after using it, AWS stills costs for the storage of snapshots (this is not only limited to EC2 service)

we will be using lambda function of python code with module a called boto3 ( for communicating with AWS API) to delete the EBS snapshots

we can also attach this function using cloudwatch /(this code (lambdafn.py) might get an error : 1.edit the time to execute to 10 sec in config tab 2. give permission to IAM roles and create policies for decribe instances, snapshots..... or you can select all permissions(worst case) )/

WhatsApp Image 2024-09-27 at 00 19 22_c23bacf8

WhatsApp Image 2024-09-27 at 00 22 21_d1083acb

WhatsApp Image 2024-09-27 at 00 24 21_719b466a

About

Lambda function identifies EBS snapshots that are no longer associated with any active EC2 instance and deletes them to save on storage costs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages