Skip to content

vwake7/ebscleanupscript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

EBS Janitor - Automated Cleanup Script

Overview

The EBS Janitor script automates the detection, backup, and deletion of orphaned EBS volumes in AWS. It helps reduce unnecessary storage costs by ensuring that unattached volumes older than seven days are identified, snapshotted for backup, and then deleted.

Features

  • Find Orphaned Volumes: Identifies unattached EBS volumes older than seven days.
  • Snapshot Creation: Creates a backup snapshot before deleting volumes.
  • Tagging for Compliance: Tags snapshots for tracking.
  • Automated Cleanup: Deletes old volumes to free up storage.

Prerequisites

  • Python 3.x
  • Boto3 (AWS SDK for Python)
  • AWS CLI configured with appropriate permissions

Installation

  1. Clone the repository or download the script.
  2. Install required dependencies:
    pip install boto3
  3. Configure AWS credentials:
    aws configure

Usage

Run the script using:

python ebs_cleanup_script.py

AWS Permissions Required

Ensure the following AWS IAM permissions are granted:

  • ec2:DescribeVolumes
  • ec2:CreateSnapshot
  • ec2:DeleteVolume
  • ec2:CreateTags

Notes

  • The script will only delete volumes that have been unattached for more than seven days.
  • Snapshots created will be tagged for tracking.

License

This project is licensed under the MIT License.

Contribution

Feel free to open issues or submit pull requests for improvements!

About

AWS EBS Cleanup script

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages