{"id":26334376,"url":"https://github.com/okelet/awsipinventory","last_synced_at":"2025-10-13T20:38:36.214Z","repository":{"id":62591270,"uuid":"323686705","full_name":"okelet/awsipinventory","owner":"okelet","description":"Tool to generate an inventory of all IP addresses in use in an account, one or multiple VPC, or one or multiple subnet.","archived":false,"fork":false,"pushed_at":"2024-07-16T16:22:12.000Z","size":179,"stargazers_count":13,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-13T11:58:32.032Z","etag":null,"topics":["aws","ec2","inventory","rds","vpc"],"latest_commit_sha":null,"homepage":"https://blog.okelet.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/okelet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"ko_fi":"okelet"}},"created_at":"2020-12-22T17:07:11.000Z","updated_at":"2024-12-13T15:42:26.000Z","dependencies_parsed_at":"2023-12-14T23:45:35.990Z","dependency_job_id":null,"html_url":"https://github.com/okelet/awsipinventory","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"6cf84756bb6427d0d73eec1b7f6ceb43987d3578"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/okelet/awsipinventory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okelet%2Fawsipinventory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okelet%2Fawsipinventory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okelet%2Fawsipinventory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okelet%2Fawsipinventory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/okelet","download_url":"https://codeload.github.com/okelet/awsipinventory/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okelet%2Fawsipinventory/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279016932,"owners_count":26085910,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","ec2","inventory","rds","vpc"],"created_at":"2025-03-16T00:18:32.594Z","updated_at":"2025-10-13T20:38:36.200Z","avatar_url":"https://github.com/okelet.png","language":"Python","funding_links":["https://ko-fi.com/okelet"],"categories":[],"sub_categories":[],"readme":"\n# AWS IP inventory\n\nTool to generate an inventory of all IP addresses in use in an account, one or multiple VPC, or one or multiple subnet.\n\nFeatures:\n\n* Detects the object type that uses the interface (EC2, RDS, etc.); not always possible because this guess is done using some magic from the interface description.\n* Filter by region, VPC and/or subnet\n* Guess a friendly name of the object (EC2 Name tag, for example)\n* Gets project and environment tags\n* Multiple output formats\n* Links to AWS web console for services/objects\n\nOutput formats:\n\n* Console table\n* HTML\n* JSON\n* YAML\n* CSV\n\nSupported services:\n\n* [x] EC2 instances\n* [x] ElastiCache (partially)\n* [x] ELB/ALB (ELBv2)\n* [x] RDS\n* [x] ECS tasks\n* [x] NAT Gateways\n* [x] EFS mount targets\n* [x] Directories\n* [x] Workspaces\n* [x] Lambda\n* [x] CodeBuild (only service, not object)\n* [x] API Gateway VPC link\n* [x] VPC endpoints\n* [x] Route53 Resolver\n* [x] Transit Gateway\n* [x] RDS Proxy\n\nInternally, the script gets the list of [network interfaces](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2.html#EC2.Client.describe_network_interfaces),\nand tries to guess to what service and object the interface is attached to; this is not always possible, because there is no a direct property\nto know it, and this must be guessed using regexs and string comparison using the interface description or the requester property.\n\nKeep in mind that some network interfaces are ephemeral, i.e. they live only for a short period of time, like the ones used in Lambda,\nECS tasks, etc. Others have a longer life, like the ones used in \"static\" EC2 instances.\n\n## Installation\n\nUsing [pipx](https://github.com/pypa/pipx):\n\n```bash\npipx install awsipinventory\n```\n\nCloning the repository, using [Poetry](https://python-poetry.org/):\n\n```bash\ngit clone https://github.com/okelet/awsipinventory\ncd awsipinventory\npoetry install\n```\n\n## Usage\n\nRemember to add `~/.local/bin` to your path if not already done:\n\n```bash\nexport PATH=${PATH}:${HOME}/.local/bin\n```\n\n```text\nusage: awsipinventory [-h] [-l {DEBUG,INFO,WARNING,ERROR,CRITICAL}]\n                      [-f {none,table,html,json,yaml,yml,csv}] [-o OUTPUT]\n                      [--regions [REGIONS [REGIONS ...]]]\n                      [--vpcs [VPCS [VPCS ...]]]\n                      [--subnets [SUBNETS [SUBNETS ...]]]\n                      [--columns [COLUMNS [COLUMNS ...]]]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -l {DEBUG,INFO,WARNING,ERROR,CRITICAL}, --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}\n                        Set the logging level\n  -f {none,table,html,json,yaml,yml,csv}, --format {none,table,html,json,yaml,yml,csv}\n                        Output format\n  -o OUTPUT, --output OUTPUT\n                        Output file; defaults to standard output\n  --regions [REGIONS [REGIONS ...]]\n                        Use \"all\" to get data from all enabled regions\n  --vpcs [VPCS [VPCS ...]]\n                        Restrict results to specific VPCs (must exist in the\n                        account and regions)\n  --subnets [SUBNETS [SUBNETS ...]]\n                        Restrict results to specific subnets (must exist in\n                        the account, VPCs and regions)\n```\n\nRunning from an standard Linux:\n\n```bash\nawsipinventory --format html --output /tmp/inventory.html \u0026\u0026 firefox /tmp/inventory.html\n```\n\nRunning from WSL:\n\n```bash\nln -s /mnt/c/Program\\ Files/Mozilla\\ Firefox/firefox.exe ~/.local/bin/firefox\nawsipinventory --format html --output /tmp/inventory.html \u0026\u0026 firefox $(wslpath -w /tmp/inventory.html)\n```\n\nFrom local development environment or cloned repository:\n\n```bash\npoetry run python -m awsipinventory\n```\n\n## Output examples\n\nConsole table:\n\n```text\n+-----------------------+----------+--------------------------+--------------------+--------------------+-------------------+-------------+--------------------------------------+------------------------------+---------+-------------+\n|                VPC ID | VPC name |                Subnet ID |        Subnet name | Private IP address | Public IP address |    Type     |                  ID                  |             Name             | Project | Environment |\n+-----------------------+----------+--------------------------+--------------------+--------------------+-------------------+-------------+--------------------------------------+------------------------------+---------+-------------+\n| vpc-xxxxxxxx          | xxx      | subnet-xxxxxxxx          | xxxxxxxxx          |    10.xxx.x.xxx    |   52.xx.xxx.xxx   |     ec2     |              i-xxxxxxxx              |       xxxxxxxxxxxxxxx        |  xxxxx  |     PRO     |\n| vpc-xxxxxxxx          | xxx      | subnet-xxxxxxxx          | xxxxxxxxx          |    10.xxx.x.xxx    |   52.0.xxx.xxx    |     ec2     |              i-xxxxxxxx              |       xxxxxxxxxxxxxxx        |  xxxxx  |     DEV     |\n| vpc-xxxxxxxx          | xxx      | subnet-xxxxxxxx          | xxxxxxxxx          |    10.xxx.x.xx     |  54.xxx.xxx.xxx   |  workspace  |             ws-xxxxxxxxx             |           xxxxxxx            |         |             |\n| vpc-xxxxxxxx          | xxx      | subnet-xxxxxxxx          | xxxxxxxxx          |    10.xxx.x.xxx    |  34.xxx.xxx.xxx   |  workspace  |             ws-xxxxxxxxx             |            xxxxxx            |         |             |\n| vpc-xxxxxxxx          | xxx      | subnet-xxxxxxxx          | xxxxxxxxx          |    10.xxx.x.xxx    |                   |  directory  |             d-xxxxxxxxxx             |            xxxxx             |         |             |\n| vpc-xxxxxxxx          | xxx      | subnet-xxxxxxxx          | xxxxxxxxx          |    10.xxx.x.xxx    |                   |     rds     |           xxxxxxxxxxxxxxx            |                              |   xxx   |   PRE/DEV   |\n| vpc-xxxxxxxx          | xxx      | subnet-xxxxxxxx          | xxxxxxxxx          |    10.xxx.x.xxx    |                   |  directory  |             d-xxxxxxxxxx             |            xxxxx             |         |             |\n| vpc-xxxxxxxx          | xxx      | subnet-xxxxxxxx          | xxxxxxxxx          |    10.xxx.x.xx     |   23.xx.xxx.xxx   | nat_gateway |        nat-xxxxxxxxxxxxxxx           |            xxxxx             |         |             |\n| vpc-xxxxxxxx          | xxx      | subnet-xxxxxxxx          | xxxxxxxxx          |    10.xxx.x.xxx    |                   |     rds     |           xxxxxxxxxxxxxxx            |                              |         |             |\n| vpc-xxxxxxxx          | xxx      | subnet-xxxxxxxx          | xxxxxxxxx          |    10.xxx.x.xxx    |                   |     rds     |           xxxxxxxxxxxxxxx            |                              |   xxx   |     PRO     |\n| vpc-xxxxxxxx          | xxx      | subnet-xxxxxxxx          | xxxxxxxxx          |    10.xxx.x.xxx    |                   |     dms     |                                      |                              |         |             |\n```\n\nJSON:\n\n```json\n[\n    {\n        \"region\": \"us-east-1\",\n        \"interface_id\": \"eni-xxxxxxxxxxxxxxxxx\",\n        \"interface_type\": \"interface\",\n        \"interface_description\": \"Primary network interface\",\n        \"interface_requested_id\": null,\n        \"interface_status\": \"in-use\",\n        \"vpc_id\": \"vpc-xxxxxxxx\",\n        \"vpc_name\": \"xxx\",\n        \"vpc_link\": \"https://console.aws.amazon.com/vpc/home?region=us-east-1#vpcs:VpcId=vpc-xxxxxxxx;sort=VpcId\",\n        \"subnet_id\": \"subnet-xxxxxxxx\",\n        \"subnet_name\": \"XXXXXX\",\n        \"subnet_link\": \"https://console.aws.amazon.com/vpc/home?region=us-east-1#subnets:SubnetId=subnet-xxxxxxxx;sort=SubnetId\",\n        \"private_ip_address\": \"10.xxx.x.xx\",\n        \"public_ip_address\": \"52.xx.xxx.xx\",\n        \"object_type\": \"ec2\",\n        \"object_id\": \"i-xxxxxxxxxxxxxxxxx\",\n        \"object_name\": \"XXXXXXX\",\n        \"object_tag_project\": null,\n        \"object_tag_environment\": \"PRO\",\n        \"object_description\": null,\n        \"object_console_url\": \"https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#Instances:search=i-xxxxxxxxxxxxxxxxx;sort=instanceId\",\n        \"object_service_url\": \"https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#Instances:\"\n    }\n]\n```\n\nHTML:\n\n![img.png](output_html.png)\n\n## Testing package deployment\n\nSet credential environment variables manually, or using another tool, like [AWSume](https://github.com/trek10inc/awsume); then test the application\nusing Docker directly:\n\n```bash\ndocker build -t awsipinventory:latest .\nawsume xxx\ndocker run -it --rm -e AWS_DEFAULT_REGION -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN awsipinventory:latest --log-level debug -f json\n```\n\nOr using `docker-compose`:\n\n```bash\nawsume xxx\ndocker-compose up --build --force-recreate\ndocker-compose rm -fs\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokelet%2Fawsipinventory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fokelet%2Fawsipinventory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokelet%2Fawsipinventory/lists"}