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 baseline --regions us-east-1,us-west-2

# Track what changed
awsinv delta --show-diff

# Find security issues
awsinv security scan --severity HIGH

# Restore to baseline (NEW!)
awsinv restore preview baseline  # See what would be deleted
awsinv restore execute baseline --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 baseline 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 baseline snapshot
awsinv snapshot create baseline --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 baseline --show-diff

# 5. Scan for security issues
awsinv security scan

# 6. Restore to baseline (removes new resources)
awsinv restore preview baseline      # Safe preview
awsinv restore execute baseline --confirm  # Actual cleanup

๐Ÿ“– Documentation

Core Workflows

1. Snapshot Your Environment
# Basic snapshot
awsinv snapshot create prod-baseline --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 baseline
awsinv delta --snapshot baseline

# Show field-level changes
awsinv delta --snapshot baseline --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 Baseline (NEW)
# Preview what would be deleted (safe, no changes)
awsinv restore preview baseline

# Shows:
# - Resources created after baseline
# - Which are protected
# - Deletion order (respects dependencies)

# Execute cleanup (requires --confirm)
awsinv restore execute baseline --confirm

# Filter by type or region
awsinv restore preview baseline --type AWS::EC2::Instance --region us-east-1

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

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

Ephemeral Environment Cleanup

# Create baseline before temporary resources
awsinv snapshot create clean-state

# After testing, restore to baseline
awsinv restore execute clean-state --confirm
# Removes all resources created after baseline

Configuration Drift Detection

# Before deployment
awsinv snapshot create pre-deploy

# After deployment - see exactly what changed
awsinv delta --snapshot pre-deploy --show-diff

๐Ÿ› ๏ธ 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.0.tar.gz (113.2 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.0-py3-none-any.whl (155.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aws_inventory_manager-0.4.0.tar.gz
  • Upload date:
  • Size: 113.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aws_inventory_manager-0.4.0.tar.gz
Algorithm Hash digest
SHA256 5f10cc5b86de36cdeb027da4516c03bb252a7456ad7e2a9d192d64af6f53ffdd
MD5 1be3dbac8e27c185307a920c35bf25b5
BLAKE2b-256 1f865c18787b4385166fd1e3653beb3b78556b711eb6256a160d7cb33915288a

See more details on using hashes here.

Provenance

The following attestation bundles were made for aws_inventory_manager-0.4.0.tar.gz:

Publisher: publish-pypi.yml on troylar/aws-inventory-manager

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for aws_inventory_manager-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 64dcd804a1d6e656f7d4abbea4bc637f1ddc28dfc320568d1349e7201f5ade90
MD5 dd4b4629dfdba578d5f4f4b081db14f9
BLAKE2b-256 9b3064515b48a8715b14f94efb598e2367ef30c526f91e54dab4b21286356f29

See more details on using hashes here.

Provenance

The following attestation bundles were made for aws_inventory_manager-0.4.0-py3-none-any.whl:

Publisher: publish-pypi.yml on troylar/aws-inventory-manager

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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