AWS Resource Inventory Management & Delta Tracking CLI tool
Project description
๐ฆ AWS Inventory Manager
Track, snapshot, and manage your AWS resources with cost analysis
A Python CLI tool that captures point-in-time snapshots of AWS resources organized by inventory, tracks resource deltas over time, analyzes costs per inventory, and provides restoration capabilities.
Features
- ๐ฆ Inventory Management: Organize snapshots into named inventories with optional tag-based filters
- ๐ธ Resource Snapshots: Capture complete inventory of AWS resources across multiple regions
- ๐ Delta Tracking: Identify resources added, modified, or removed since a snapshot
- ๐ฐ Cost Analysis: Analyze costs for resources within a specific inventory
- ๐ง Resource Restoration: Remove resources added since a snapshot to return to that state
- ๐ท๏ธ Filtered Snapshots: Create snapshots filtered by tags for specific teams or environments
- ๐ Multi-Account Support: Manage inventories across multiple AWS accounts
- ๐ Snapshot Management: Manage multiple snapshots per inventory with active snapshot tracking
Quick Start
Installation
# Install from PyPI
pip install aws-inventory-manager
# Or install from source
git clone https://github.com/troylar/aws-inventory-manager.git
cd aws-inventory-manager
pip install -e .
Prerequisites
- Python 3.8 or higher
- AWS CLI configured with credentials
- IAM permissions for resource read/write operations
Getting Started in 5 Minutes
Follow these steps for a complete walkthrough from setup to cost analysis:
1. Create an inventory (a named collection for organizing snapshots)
awsinv inventory create prod-baseline --description "Production baseline resources"
2. Take your first snapshot (capture current AWS resources)
awsinv snapshot create initial --regions us-east-1 --inventory prod-baseline
This captures all resources in us-east-1 and stores them in the prod-baseline inventory.
3. Make changes to your AWS environment (optional)
- Deploy new resources, update configurations, etc.
- Then take another snapshot to track what changed
4. Compare snapshots (see what changed)
awsinv delta --snapshot initial --inventory prod-baseline
This shows all resources added, removed, or modified since the initial snapshot.
5. Analyze costs
# Costs since snapshot was created
awsinv cost --snapshot initial --inventory prod-baseline
# Costs for specific date range
awsinv cost --snapshot initial --inventory prod-baseline \
--start-date 2025-01-01 --end-date 2025-01-31
6. List your resources
# List all inventories
awsinv inventory list
# List snapshots in your inventory
awsinv snapshot list --inventory prod-baseline
# Show snapshot details
awsinv snapshot show initial --inventory prod-baseline
Advanced: Use AWS profiles and tag filtering
# Use a specific AWS profile
awsinv --profile production snapshot create initial --regions us-east-1 --inventory prod-baseline
# Filter snapshot by tags (only include resources with specific tags)
awsinv snapshot create prod-only --regions us-east-1 \
--include-tags Environment=production,Team=platform
# Exclude resources with certain tags
awsinv snapshot create non-dev --regions us-east-1 \
--exclude-tags Environment=development
That's it! You're now tracking AWS resources, comparing changes, and analyzing costs.
Configuration
The tool stores snapshots in ~/.snapshots by default. You can customize this using:
Environment Variable:
export AWS_INVENTORY_STORAGE_PATH=/path/to/snapshots
CLI Parameter (highest priority):
awsinv --storage-path /custom/path inventory list
Precedence: CLI parameter > Environment variable > Default (~/.snapshots)
Basic Usage
# Create a named inventory for organizing snapshots
awsinv inventory create infrastructure \
--description "Core infrastructure resources"
# Create a filtered inventory for a specific team
awsinv inventory create team-alpha \
--description "Team Alpha resources" \
--include-tags "Team=Alpha"
# Take a snapshot (automatically uses 'default' inventory if none specified)
awsinv snapshot create
# Take a snapshot within a specific inventory
awsinv snapshot create --inventory infrastructure
# List all inventories
awsinv inventory list
# View what's changed since the snapshot
awsinv delta
# View delta for specific inventory
awsinv delta --inventory team-alpha
# Analyze costs for a specific inventory
awsinv cost --inventory infrastructure
# Analyze costs for team inventory
awsinv cost --inventory team-alpha
# List all snapshots
awsinv snapshot list
# Migrate legacy snapshots to inventory structure
awsinv inventory migrate
Use Cases
Multi-Account Resource Management
Organize snapshots by AWS account and purpose. Track costs per account.
# Create inventory for core infrastructure account
awsinv inventory create infrastructure \
--description "Core infrastructure resources"
# Take snapshot
awsinv snapshot create --inventory infrastructure
# Analyze costs for this inventory
awsinv cost --inventory infrastructure
Team-Based Resource Tracking
Create filtered inventories for different teams to track their resources and costs independently.
# Create team-specific inventories with tag filters
awsinv inventory create team-alpha \
--include-tags "Team=Alpha" \
--description "Team Alpha resources"
awsinv inventory create team-beta \
--include-tags "Team=Beta" \
--description "Team Beta resources"
# Take filtered snapshots for each team
awsinv snapshot create --inventory team-alpha
awsinv snapshot create --inventory team-beta
# Analyze costs per team
awsinv cost --inventory team-alpha
awsinv cost --inventory team-beta
Environment Isolation
Separate production, staging, and development resources for independent tracking.
# Create environment-specific inventories
awsinv inventory create production \
--include-tags "Environment=production"
awsinv inventory create staging \
--include-tags "Environment=staging"
# Track changes for each environment
awsinv delta --inventory production
awsinv delta --inventory staging
# Analyze costs per environment
awsinv cost --inventory production
awsinv cost --inventory staging
Documentation
For complete documentation including installation guide, command reference, usage examples, and best practices, run:
awsinv --help
awsinv quickstart
Supported AWS Services
The tool captures resources from 25 AWS services:
- IAM: Roles, Users, Groups, Customer-Managed Policies
- Lambda: Functions, Layers
- S3: Buckets (with versioning, encryption metadata)
- EC2: Instances, Volumes, VPCs, Security Groups, Subnets, VPC Endpoints (Interface & Gateway)
- RDS: DB Instances, DB Clusters (Aurora)
- CloudWatch: Alarms (Metric & Composite), Log Groups
- SNS: Topics
- SQS: Queues
- DynamoDB: Tables
- ELB: Load Balancers (Classic ELB, ALB, NLB, GWLB)
- CloudFormation: Stacks
- API Gateway: REST APIs, HTTP APIs, WebSocket APIs
- EventBridge: Event Buses, Event Rules
- Secrets Manager: Secrets (metadata only, values excluded)
- KMS: Customer-Managed Keys (with rotation status)
- Systems Manager: Parameter Store Parameters, SSM Documents
- Route53: Hosted Zones (public and private)
- ECS: Clusters, Services, Task Definitions
- EKS: Clusters, Node Groups, Fargate Profiles
- Step Functions: State Machines
- WAF: Web ACLs (Regional and CloudFront)
- CodePipeline: CI/CD Pipelines
- CodeBuild: Build Projects
- Backup: Backup Plans, Backup Vaults
Architecture
- Language: Python 3.8+
- CLI Framework: Typer
- AWS SDK: boto3
- Output: Rich terminal UI
- Storage: Local YAML files
Development
Setup
# Install development dependencies
pip install -e ".[dev]"
# Verify installation
awsinv --help
Testing
Use invoke for all development tasks:
# Run all tests with coverage
invoke test
# Run unit tests only
invoke test-unit
# Run integration tests only
invoke test-integration
# Run tests with verbose output
invoke test --verbose
# Generate HTML coverage report
invoke coverage-report
Code Quality
# Run all quality checks (format, lint, typecheck)
invoke quality
# Auto-fix formatting and linting issues
invoke quality --fix
# Format code
invoke format
# Check formatting without changes
invoke format --check
# Lint code
invoke lint
# Auto-fix linting issues
invoke lint --fix
# Type check
invoke typecheck
Build & Release
# Clean build artifacts
invoke clean
# Build package
invoke build
# Show version
invoke version
# Run all CI checks (quality + tests)
invoke ci
Available Invoke Tasks
# List all available tasks
invoke --list
Project Structure
aws-inventory-manager/
โโโ src/
โ โโโ cli/ # CLI entry point and commands
โ โโโ models/ # Data models (Snapshot, Inventory, Resource, etc.)
โ โโโ snapshot/ # Snapshot capture and inventory storage
โ โโโ delta/ # Delta calculation
โ โโโ cost/ # Cost analysis
โ โโโ aws/ # AWS client utilities
โ โโโ utils/ # Shared utilities
โโโ tests/
โ โโโ unit/ # Unit tests
โ โโโ integration/ # Integration tests
โโโ ~/.snapshots/ # Default snapshot storage
โโโ inventories.yaml # Inventory metadata
โโโ snapshots/ # Individual snapshot files
Command Reference
Inventory Commands
# Create an inventory
awsinv inventory create <name> \
[--description "Description"] \
[--include-tags "Key1=Value1,Key2=Value2"] \
[--exclude-tags "Key3=Value3"] \
[--profile <aws-profile>]
# List all inventories for current account
awsinv inventory list [--profile <aws-profile>]
# Show detailed inventory information
awsinv inventory show <name> [--profile <aws-profile>]
# Delete an inventory
awsinv inventory delete <name> \
[--force] \
[--profile <aws-profile>]
# Migrate legacy snapshots to inventory structure
awsinv inventory migrate [--profile <aws-profile>]
Snapshot Commands
# Create a snapshot
awsinv snapshot create [name] \
[--inventory <inventory-name>] \
[--regions <region1,region2>] \
[--include-tags "Key=Value"] \
[--exclude-tags "Key=Value"] \
[--before-date YYYY-MM-DD] \
[--after-date YYYY-MM-DD] \
[--compress] \
[--profile <aws-profile>]
# List all snapshots
awsinv snapshot list [--profile <aws-profile>]
# Show snapshot details
awsinv snapshot show <name> [--profile <aws-profile>]
Analysis Commands
# View resource delta
awsinv delta \
[--inventory <inventory-name>] \
[--snapshot <snapshot-name>] \
[--resource-type <type>] \
[--region <region>] \
[--show-details] \
[--export <file.json|file.csv>] \
[--profile <aws-profile>]
# Analyze costs for an inventory
awsinv cost \
[--inventory <inventory-name>] \
[--snapshot <snapshot-name>] \
[--start-date YYYY-MM-DD] \
[--end-date YYYY-MM-DD] \
[--granularity DAILY|MONTHLY] \
[--show-services] \
[--export <file.json|file.csv>] \
[--profile <aws-profile>]
Contributing
Contributions are welcome! Please read the contributing guidelines before submitting pull requests.
License
MIT License - see LICENSE file for details
Support
- Report issues: https://github.com/troylar/aws-inventory-manager/issues
- Documentation: https://github.com/troylar/aws-inventory-manager#readme
Version: 0.2.0 Status: Alpha Python: 3.8 - 3.13
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.2.0.tar.gz.
File metadata
- Download URL: aws_inventory_manager-0.2.0.tar.gz
- Upload date:
- Size: 68.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e97761f12bb1a4669aeff94130aa6f5fb3e3e663ae47d624311ade489467eed1
|
|
| MD5 |
35cf3570b3ffa163c81691d9094029ca
|
|
| BLAKE2b-256 |
8978f0cb7a9458e1fb08f8b3f22a0197c9b27fba35a547c35d5837dc5a165c77
|
Provenance
The following attestation bundles were made for aws_inventory_manager-0.2.0.tar.gz:
Publisher:
publish-pypi.yml on troylar/aws-inventory-manager
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aws_inventory_manager-0.2.0.tar.gz -
Subject digest:
e97761f12bb1a4669aeff94130aa6f5fb3e3e663ae47d624311ade489467eed1 - Sigstore transparency entry: 651886580
- Sigstore integration time:
-
Permalink:
troylar/aws-inventory-manager@b1350d0fd8a8208c3ac366f22338d871f28c0337 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/troylar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@b1350d0fd8a8208c3ac366f22338d871f28c0337 -
Trigger Event:
release
-
Statement type:
File details
Details for the file aws_inventory_manager-0.2.0-py3-none-any.whl.
File metadata
- Download URL: aws_inventory_manager-0.2.0-py3-none-any.whl
- Upload date:
- Size: 93.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ae8b873ce47f6d1ed1baa3a6fe9d110bc4b810465735d52de3f6d2bc9cd268a
|
|
| MD5 |
b66dad7e69032342dc94db40eccf606f
|
|
| BLAKE2b-256 |
a6def1fd4b8af2302ab3b88dd7e0ed3f1ad63a951c5397c78cfffedf0a46b201
|
Provenance
The following attestation bundles were made for aws_inventory_manager-0.2.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on troylar/aws-inventory-manager
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aws_inventory_manager-0.2.0-py3-none-any.whl -
Subject digest:
2ae8b873ce47f6d1ed1baa3a6fe9d110bc4b810465735d52de3f6d2bc9cd268a - Sigstore transparency entry: 651886587
- Sigstore integration time:
-
Permalink:
troylar/aws-inventory-manager@b1350d0fd8a8208c3ac366f22338d871f28c0337 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/troylar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@b1350d0fd8a8208c3ac366f22338d871f28c0337 -
Trigger Event:
release
-
Statement type: