Inventory one AWS account or your whole AWS Organization, then query it with SQL or plain English
A fast, comprehensive tool for mapping and inventorying AWS resources across 150+ services and all regions. Scan one account, or every account of an AWS Organization with awsmap org (v1.9.0), store results in a local SQLite database, and query your inventory using SQL or natural language. Compare scans over time with drift detection, find idle resources with waste detection, and audit tag compliance. Includes 30 pre-built security, compliance and inventory queries, 1,381 example questions and HTML, JSON and CSV output. Available on PyPI (Python 3.10 or later) and Docker Hub (amd64 and arm64).
pip install awsmap
docker pull tarekcheikh/awsmap
# Full account inventory awsmap -p myprofile # Specific services & regions awsmap -p myprofile -s ec2,s3,rds -r us-east-1,eu-west-1 # Filter by tags awsmap -p myprofile -t Owner=John -t Environment=Production
# Custom SQL on your inventory awsmap query "SELECT service, COUNT(*) FROM resources GROUP BY service" # Pre-built security queries awsmap query -n admin-users awsmap query -n public-s3-buckets awsmap query -n open-security-groups
# Ask in plain English awsmap ask how many resources per region awsmap ask show me all EC2 instances without Owner tag awsmap ask which S3 buckets are in eu-west-1
# Browse 1,381 example questions awsmap examples awsmap examples lambda awsmap examples lambda 5 awsmap examples --search "encryption"
# Check that awsmap can reach every member account (no resource is scanned) awsmap org -p org-root --dry-run # Scan the organization, one OU, or chosen accounts awsmap org -p org-root awsmap org -p org-root --ou ou-prod-12345678 awsmap org -p org-root --accounts 111122223333,444455556666 # Finish an interrupted scan awsmap org -p org-root --resume
# What changed since the last scan, or in the last 7 days? awsmap diff awsmap diff --from 7d # Idle or wasteful resources, from data already collected awsmap waste # Tag compliance against required tags awsmap tags -R Owner,Environment,CostCenter
awsmap demo awsmap query --db ~/.awsmap/demo.db -n admin-users awsmap diff --db ~/.awsmap/demo.db --from 30d
| Option | Description |
|---|---|
-p, --profile | AWS profile name |
-r, --region | Region(s) to scan (comma-separated) |
-s, --services | Service(s) to scan (comma-separated) |
-t, --tag | Filter by tag Key=Value (multiple allowed) |
-f, --format | Output: html (default), json, csv |
-o, --output | Output file path |
-w, --workers | Parallel workers (default: 40) |
-q, --quiet | Suppress progress output |
--timings | Show timing summary per service |
--exclude-defaults | Exclude default AWS resources |
--no-db | Skip database storage |
--list-services | List available service collectors |
query <SQL> | Run a SQL query against inventory |
query -n <name> | Run a pre-built named query |
query -l | List all pre-built queries |
query -a <account> | Scope query to a specific account |
ask <question> | Query inventory in natural language |
examples [service] | Browse example questions by service |
examples --search <keyword> | Search across all example questions |
config set <key> <value> | Set a config value (profile, regions, etc.) |
config list | Show all configuration |
completion <shell> | Generate shell completion (bash/zsh/fish) |
org -p <profile> | Scan every account of an AWS Organization (management or delegated admin profile) |
org --dry-run | Check role assumption in the member accounts without scanning resources |
org --ou <id> / --accounts <list> | Limit the organization scan to one OU (child OUs included) or to chosen accounts (IDs, aliases or names) |
org --exclude <list> | Leave out accounts (IDs, aliases or names) |
org --resume | Skip accounts whose latest scan in the last 24 hours had no incomplete service |
org --role-name <name> | Role to assume in member accounts (default: OrganizationAccountAccessRole) |
diff [--from <date>] [--to <date>] | Compare snapshots: added, removed and modified resources |
waste | Find potentially idle or wasteful resources |
tags -R <keys> | Audit tag compliance against required tag keys |
query --scan <latest|previous|first|scan_id> | Run a query against a specific scan instead of the current snapshot |
demo | Generate a demo database with synthetic inventory data |
admin-rolesIAM roles with admin policies attachedadmin-usersIAM users with admin permissions (direct or via group membership)cross-account-rolesIAM roles with trust policies allowing external accountsdefault-vpcsDefault VPCs across all regionsebs-unencryptedEBS volumes without encryptionencryption-statusS3 buckets and their encryption configurationiam-inactive-usersIAM users who have never logged in or have no access keyslambda-high-memoryLambda functions with memory greater than 512 MBlambda-runtimesLambda functions grouped by runtimemissing-tagResources missing a required tag (default: Owner)old-access-keysIAM users with access keys (check create_date for age)open-security-groupsSecurity groups with inbound rules open to 0.0.0.0/0public-s3-bucketsS3 buckets with public access enabledrds-enginesRDS instances grouped by enginerds-no-multi-azRDS instances without Multi-AZ enabledrds-publicRDS instances with public access enabledrds-unencryptedRDS instances without encryptionresources-by-accountResource count per accountresources-by-regionResource count per regionresources-by-serviceResource count per service and typeresources-by-tagResources that have a specific tag (default: Owner)resources-per-account-serviceResource count per account per services3-no-loggingS3 buckets without access logging enableds3-no-versioningS3 buckets without versioning enabledsecrets-no-rotationSecrets Manager secrets without automatic rotationstopped-instancesEC2 instances in stopped stateuntagged-resourcesResources without any tagsunused-eipsElastic IPs not associated with any instanceunused-volumesEBS volumes not attached to any instanceusers-without-mfaIAM users without MFA enabledWe can help you deploy and customize this tool for your specific needs, or build custom solutions.
Contact Us