A comprehensive Python-based tool for automatically generating CloudWatch dashboards to monitor Amazon EBS (Elastic Block Store) volumes attached to EC2 instances. The tool creates detailed dashboards with IOPS and throughput metrics for each volume.
-
Automatic Dashboard Generation
- Creates CloudWatch dashboards for EBS volumes
- Monitors IOPS and throughput for each volume
- Supports multiple volumes per instance
- Real-time metric visualization
-
Volume Metrics
- IOPS monitoring with actual volume limits
- Throughput tracking with volume-specific thresholds
- Automatic volume discovery for EC2 instances
- Support for named volumes via tags
-
Interactive Setup
- Region selection from available AWS regions
- EC2 instance selection
- Custom dashboard naming
- Volume name customization
-
Visual Enhancements
- Progress bars for long-running operations
- Colored console output for better readability
- Clear error messages and status updates
- Python 3.6 or higher
- AWS credentials configured (
~/.aws/credentials
or environment variables) - Required Python packages (see
requirements.txt
):boto3>=1.26.137,<2.0.0 colorama>=0.4.6,<1.0.0 tqdm>=4.65.0,<5.0.0
-
Clone the repository:
git clone https://github.com/mohit6298/EBSDashboard.git cd EBSDashboard
-
Install required packages:
pip install -r requirements.txt
Run the script:
python ebs_dashboard_generator.py
-
Select AWS Region:
- Choose from the list of available regions
- Validates region selection
-
Provide EC2 Instance ID:
- Enter the ID of the target EC2 instance
- Format: i-xxxxxxxxxxxxxxxxx
- Validates instance ID format
-
Set Dashboard Name:
- Enter a custom name for the CloudWatch dashboard
- Used for easy identification in CloudWatch
-
Volume Configuration:
- Automatically discovers attached EBS volumes
- Uses volume tags if available
- Allows custom naming for untagged volumes
- Combined read and write operations
- Actual IOPS limit visualization
- 1-minute granularity
- Automatic scaling
- Combined read and write throughput
- Volume-specific throughput limits
- Byte-based measurements
- Automatic unit conversion
The following IAM permissions are required:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DescribeVolumes",
"ec2:DescribeRegions",
"cloudwatch:PutDashboard",
"cloudwatch:GetDashboard"
],
"Resource": "*"
}
]
}
The script includes comprehensive error handling for:
- AWS API failures
- Invalid user inputs
- Resource access issues
- Network connectivity problems
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
For support:
- Open an issue in the repository
- Include:
- Script version
- Python version
- AWS region
- Error message (if applicable)
- Steps to reproduce
- Never commit AWS credentials
- Use IAM roles when possible
- Regularly rotate access keys
- Follow AWS security best practices
- AWS SDK for Python (Boto3)
- CloudWatch Metrics API
- EC2 API