A Python CLI tool that retrieves AWS EC2 instance information and generates simple usage reports for monitoring cloud environments.
Overview
This project demonstrates basic cloud infrastructure monitoring using the AWS SDK for Python (boto3). The tool queries EC2 instances and reports information such as instance IDs, current status, and launch time.
The goal of the project is to explore how infrastructure engineers and developers interact with cloud APIs to inspect and monitor computing resources.
Features
- Retrieve EC2 instance metadata
- Display instance IDs and instance state
- Show instance launch time
- Generate simple usage reports
- Command-line interface for quick infrastructure inspection
Technologies Used
- Python
- AWS EC2
- boto3 (AWS SDK for Python)
- AWS CLI
- Git
Project Structure
cloud-ec2-monitor/│├── monitor.py├── usage_report.txt├── requirements.txt├── README.md└── .gitignoreSetup
1. Clone the repository
git clone https://github.com/BerkGozek/cloud-monitor.gitcd cloud-monitor2. Create a virtual environment
python3 -m venv .venvsource .venv/bin/activate3. Install dependencies
pip install -r requirements.txt4. Configure AWS credentials
Before running the tool, configure AWS CLI credentials:
aws configureYou will be prompted to enter:
AWS Access Key IDAWS Secret Access KeyDefault region name (example: us-east-1)Default output format (json recommended)Running the Tool
Run the monitoring script:
python monitor.pyTo generate a usage report file:
python monitor.py > usage_report.txtExample Output
Instance ID: i-0123456789abcdef0Status: runningLaunch Time: 2026-03-10T14:22:31ZUse Case
This tool simulates a lightweight infrastructure monitoring workflow used by cloud engineers and DevOps teams to inspect compute resources in a cloud environment.
It demonstrates how developers can use Python to interact with cloud APIs and retrieve operational data from infrastructure services.
Future Improvements
Potential improvements for this project include:
- Support for additional AWS services (S3, Lambda, RDS)
- Automatic report generation and logging
- Monitoring alerts for instance state changes
- Command-line arguments for filtering or selecting regions
- Integration with monitoring dashboards