Skip to main content

AWS Resource Inventory Management & Delta Tracking CLI tool

Project description

๐Ÿ“ฆ AWS Inventory Manager

Snapshot, Track, Secure, and Restore Your AWS Environment

CI Coverage PyPI version Python 3.8+ License: MIT

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

  • 27 AWS services
  • Multi-region support
  • Tag-based filtering
  • Point-in-time capture
  • Export to JSON/CSV

๐Ÿ” Track Changes

  • Field-level drift detection
  • Before/after comparison
  • Color-coded output
  • Configuration + security changes
  • JSON export

๐Ÿ”’ Security

  • 12+ CIS-aligned checks
  • Severity levels (CRITICALโ†’LOW)
  • Find public buckets, open ports
  • IAM credential age
  • Remediation guidance

๐Ÿ’ฐ Cost Analysis

  • Per-inventory tracking
  • Date range analysis
  • Service-level breakdown
  • Multi-account support
  • Team attribution

๐Ÿงน Restore (NEW)

  • Preview mode (dry-run)
  • Dependency-aware deletion
  • Multi-layer protection rules
  • Comprehensive audit logs
  • Supports 32+ resource types

๐Ÿ“Š Reporting

  • Summary & detailed views
  • Resource type filtering
  • Multiple export formats
  • Beautiful terminal UI
  • Pagination support

๐Ÿš€ 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:

  1. Fork the repository
  2. Create a feature branch
  3. Run tests: invoke test
  4. Run quality checks: invoke quality
  5. Submit a pull request

See CONTRIBUTING.md for details.


๐Ÿ“œ License

MIT License - see LICENSE


๐Ÿ†˜ Support


Made with โค๏ธ for AWS practitioners

Star on GitHub

Version 0.4.0 โ€ข Python 3.8 - 3.13 โ€ข Status Alpha

โฌ† Back to Top

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

aws_inventory_manager-0.4.2.tar.gz (113.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aws_inventory_manager-0.4.2-py3-none-any.whl (155.7 kB view details)

Uploaded Python 3

File details

Details for the file aws_inventory_manager-0.4.2.tar.gz.

File metadata

  • Download URL: aws_inventory_manager-0.4.2.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

Hashes for aws_inventory_manager-0.4.2.tar.gz
Algorithm Hash digest
SHA256 401befa5370c7e3b00e5cbf48713982fb8639107f1f5a474933bc7ea16cbb639
MD5 5931fc2d6f0d190841cbcde078f90bb3
BLAKE2b-256 5b5ba18a17e59af115f1bff1d62d997276e2be99bf975f43e657da5a10f4ba7f

See more details on using hashes here.

File details

Details for the file aws_inventory_manager-0.4.2-py3-none-any.whl.

File metadata

File hashes

Hashes for aws_inventory_manager-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 662bc37a827fb09f9653a5091bee6e34e0fded091e63c57560701c1e2954788e
MD5 772b518700e3d07001b68aa19e5a30fb
BLAKE2b-256 a5080b76b2d673a7a0ebdecbe22ff368bf97f51192c2b6c87fe18061e7928ebf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page