AWS Resource Inventory Management & Delta Tracking CLI tool
Project description
๐ฆ AWS Inventory Manager
Snapshot, Track, Secure, and Restore Your AWS Environment
Snapshots โข Configuration Drift โข Security Scanning โข Cost Analysis โข Resource Cleanup โข 27 AWS Services
Quick Start โข Features โข Documentation
๐ฏ What It Does
AWS Inventory Manager gives you complete visibility and control over your AWS resources:
# Capture your environment
awsinv snapshot create my-snapshot --regions us-east-1,us-west-2
# Track what changed
awsinv delta --show-diff
# Find security issues
awsinv security scan --severity HIGH
# Restore to any snapshot (NEW!)
awsinv restore preview my-snapshot # See what would be deleted
awsinv restore execute my-snapshot --confirm # Clean up new resources
Why You Need This
- "What changed?" โ Field-level configuration drift detection
- "Are we secure?" โ Automated CIS Benchmark security scanning
- "Can we restore?" โ Delete resources created after any snapshot
- "How much does this cost?" โ Per-inventory cost tracking
- "Who owns what?" โ Tag-based filtering and team isolation
โจ Features
๐ธ Snapshot
|
๐ Track Changes
|
๐ Security
|
๐ฐ Cost Analysis
|
๐งน Restore (NEW)
|
๐ Reporting
|
๐ Quick Start
Installation
pip install aws-inventory-manager
60-Second Demo
# 1. Create a snapshot
awsinv snapshot create my-snapshot --regions us-east-1
# 2. See what you have
awsinv snapshot report
# 3. Make some changes in AWS console...
# 4. Track what changed
awsinv delta --snapshot my-snapshot --show-diff
# 5. Scan for security issues
awsinv security scan
# 6. Restore to snapshot (removes new resources)
awsinv restore preview my-snapshot # Safe preview
awsinv restore execute my-snapshot --confirm # Actual cleanup
๐ Documentation
Core Workflows
1. Snapshot Your Environment
# Basic snapshot
awsinv snapshot create prod-snapshot --regions us-east-1,us-west-2
# With tag filtering
awsinv snapshot create team-alpha \
--include-tags "Team=Alpha" \
--regions us-east-1
# Generate report
awsinv snapshot report --detailed
awsinv snapshot report --export report.json
What gets captured: EC2, S3, RDS, Lambda, VPCs, IAM, KMS, and 24 more services
2. Track Configuration Changes
# See what changed since snapshot
awsinv delta --snapshot my-snapshot
# Show field-level changes
awsinv delta --snapshot my-snapshot --show-diff
Example output:
Configuration Changes:
Instance i-abc123:
InstanceType: t2.micro โ t2.small
Tags.Environment: dev โ prod
Security Changes:
Bucket my-bucket:
PublicAccessBlockConfiguration.BlockPublicAcls: true โ false โ ๏ธ
3. Scan for Security Issues
# Scan all security checks
awsinv security scan
# Filter by severity
awsinv security scan --severity CRITICAL
# Export findings
awsinv security scan --export findings.json
Checks include:
- Public S3 buckets (CRITICAL)
- Open SSH/RDP ports (HIGH)
- Unencrypted databases (HIGH)
- Old IAM keys (MEDIUM)
- IMDSv1 on EC2 (MEDIUM)
4. Restore to Snapshot (NEW)
# Preview what would be deleted (safe, no changes)
awsinv restore preview prod-baseline
# Shows:
# - Resources created after the snapshot
# - Which are protected
# - Deletion order (respects dependencies)
# Execute cleanup (requires --confirm)
awsinv restore execute prod-baseline --confirm
# Filter by type or region
awsinv restore preview my-snapshot --type AWS::EC2::Instance --region us-east-1
Works with any snapshot - use whatever naming convention fits your workflow.
Safety features:
- Preview mode (dry-run)
- Multiple confirmations required
- Tag-based protection rules
- Type/age/cost-based protection
- Dependency-aware deletion order
- Comprehensive audit logging
Protection rules example:
# Protected resources are automatically skipped:
# - Resources with Protection=true tag
# - Critical resource types (e.g., production databases)
# - Resources younger than threshold
# - High-cost resources (configurable)
5. Analyze Costs
# Current costs
awsinv cost
# Date range
awsinv cost --start-date 2025-01-01 --end-date 2025-01-31
# By service
awsinv cost --show-services
Command Reference
# SNAPSHOTS
awsinv snapshot create [name] [--regions <regions>]
awsinv snapshot list
awsinv snapshot report [--detailed] [--export <file>]
# ANALYSIS
awsinv delta [--snapshot <name>] [--show-diff]
awsinv security scan [--severity <level>] [--export <file>]
awsinv cost [--start-date <date>] [--show-services]
# RESTORE (NEW)
awsinv restore preview <snapshot> # Safe preview mode
awsinv restore execute <snapshot> --confirm # Delete new resources
[--type <resource-type>] # Filter by type
[--region <region>] # Filter by region
[--profile <aws-profile>] # AWS profile
# GLOBAL OPTIONS
--profile <aws-profile> # AWS CLI profile
--storage-path <path> # Custom storage location
--help # Show help
๐ Supported Services
27 AWS Services: EC2, Lambda, ECS, EKS, S3, EBS, EFS, RDS, DynamoDB, ElastiCache, VPC, Security Groups, Load Balancers, Route53, IAM, KMS, Secrets Manager, CodePipeline, CodeBuild, CloudFormation, Step Functions, CloudWatch, EventBridge, SNS, SQS, WAF, Backup
Restore supports 32+ resource types with intelligent dependency resolution.
๐ฏ Use Cases
Baseline State Management
# Capture your production baseline
awsinv snapshot create prod-baseline
# Later, restore to baseline state
awsinv restore execute prod-baseline --confirm
# Removes all resources created after the baseline
Ephemeral Environment Cleanup
# Create snapshot before temporary resources
awsinv snapshot create clean-state
# After testing, restore to snapshot
awsinv restore execute clean-state --confirm
Configuration Drift Detection
# Before deployment
awsinv snapshot create pre-deploy
# After deployment - see exactly what changed
awsinv delta --snapshot pre-deploy --show-diff
Multi-Team Cost Attribution
# Track costs per team
awsinv snapshot create team-frontend --include-tags "Team=Frontend"
awsinv cost --snapshot team-frontend
Security Compliance Audits
# CIS compliance reporting
awsinv security scan --cis-only --export audit.csv
๐ ๏ธ Development
Setup & Testing
# Setup
git clone https://github.com/troylar/aws-inventory-manager.git
cd aws-inventory-manager
pip install -e ".[dev]"
# Run tests
invoke test # All tests with coverage
invoke test-unit # Unit tests only
invoke quality # Format, lint, typecheck
invoke quality --fix # Auto-fix issues
# Build
invoke build # Build package
invoke ci # Run all CI checks
Test Coverage: 600+ tests across the codebase with 52% overall coverage. Restore module has 98.5% coverage (153 tests).
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ AWS Inventory Manager (CLI) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Commands โ
โ โโ snapshot (Capture resources) โ
โ โโ delta (Track changes) โ
โ โโ security (Scan misconfigurations) โ
โ โโ cost (Analyze spending) โ
โ โโ restore (Cleanup resources) โจ NEW โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Core Engine โ
โ โโ 27 Resource Collectors (boto3) โ
โ โโ Configuration Differ (field-level) โ
โ โโ Security Scanner (CIS aligned) โ
โ โโ Cost Analyzer (AWS Cost Explorer) โ
โ โโ Resource Cleanup (dependency-aware) โจ NEW โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Storage Layer (YAML) โ
โ โโ ~/.snapshots/snapshots/*.yaml โ
โ โโ ~/.snapshots/audit-logs/**/*.yaml โจ NEW โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Tech Stack: Python 3.8+ โข Typer โข Rich โข boto3 โข YAML โข pytest
๐ค Contributing
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Run tests:
invoke test - Run quality checks:
invoke quality - Submit a pull request
See CONTRIBUTING.md for details.
๐ License
MIT License - see LICENSE
๐ Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with โค๏ธ for AWS practitioners
Version 0.4.0 โข Python 3.8 - 3.13 โข Status Alpha
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aws_inventory_manager-0.4.3.tar.gz.
File metadata
- Download URL: aws_inventory_manager-0.4.3.tar.gz
- Upload date:
- Size: 113.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cae60836e5a5152ede1a8d14539c8232ffbcfc91361f76cf243476ca22af9d4b
|
|
| MD5 |
2b2299246944ff919d874878e21dc8ab
|
|
| BLAKE2b-256 |
0c0d257c6387f6e5b6cdb9bf1406a75c2dc056b66a6c836671666a76d83d0969
|
File details
Details for the file aws_inventory_manager-0.4.3-py3-none-any.whl.
File metadata
- Download URL: aws_inventory_manager-0.4.3-py3-none-any.whl
- Upload date:
- Size: 155.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc30d2ed86c4dfcc292cc04a76178a510d84841a2a6578f065f6074ed63688a1
|
|
| MD5 |
404c76d5b46ce9819716a3bcef7dec94
|
|
| BLAKE2b-256 |
3a79d7d558369ad0cfea8a800880fa57215d738fa61c60aa4d5c95838aec4310
|