Your First Snapshot¶
This tutorial walks you through creating your first inventory snapshot, viewing what was captured, and comparing changes over time.
Key Concepts¶
| Term | Meaning |
|---|---|
| Collection | A named container for organizing snapshots by environment, team, or purpose. Create a collection first, then add snapshots to it. |
| Snapshot | A point-in-time inventory of your AWS resources (stored in local SQLite database). Not an EBS/RDS snapshot. |
| Cleanup | Delete resources that were created after a snapshot, returning to that baseline state. |
| Purge | Delete all resources except those matching protection rules. Filter by creator or date range. |
| Query | Search and analyze resources across snapshots using SQL or built-in filters. |
| IaC Generation | Generate Terraform or CDK code from a snapshot's resources. Requires pip install aws-inventory-manager[generate]. |
Step 1: Create a Collection¶
Collections organize your snapshots by environment, team, or purpose. Start by creating one:
Step 2: Create a Snapshot¶
Capture the current state of your AWS resources into the collection:
This takes 30--60 seconds depending on resource count. The tool scans 27 AWS services and catalogs 80+ resource types.
Tip
If you have AWS Config enabled, collection can be up to 5x faster. The tool detects it automatically.
Step 3: View What Was Captured¶
Output:
+------------------------------------------+
| Snapshot: my-baseline |
| Resources: 127 |
| Regions: us-east-1 |
+------------------------------------------+
| EC2 Instances: 12 |
| S3 Buckets: 8 |
| Lambda Functions: 23 |
| IAM Roles: 45 |
| ... |
+------------------------------------------+
For a detailed view of all resources:
Step 4: Track Changes¶
After making changes to your AWS environment, compare against your baseline:
This shows:
- New resources created since the snapshot
- Resources that were deleted
- Configuration changes (field-level diff)
Step 5: Export Your Snapshot¶
Export data for external analysis:
# Export to JSON
awsinv snapshot export my-baseline -o inventory.json
# Export to CSV
awsinv snapshot export my-baseline -o inventory.csv
# Export to YAML
awsinv snapshot export my-baseline -o inventory.yaml
Step 6: Generate IaC from Your Snapshot¶
Turn your captured inventory into infrastructure as code:
pip install aws-inventory-manager[generate]
awsinv generate terraform my-baseline --output ./terraform
This generates Terraform files for all resources in your snapshot. You can also generate CDK TypeScript or CDK Python. See the IaC Generation guide for full options.
Next Steps¶
- Common Workflows -- practical scenarios for daily use
- IaC Generation -- generate Terraform or CDK from your snapshots
- Snapshots guide -- advanced snapshot features
- Change Tracking -- deep-dive into delta analysis
- Security Scanning -- find security issues