inventag-aws 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. inventag_aws-1.0.0/LICENSE +21 -0
  2. inventag_aws-1.0.0/PKG-INFO +202 -0
  3. inventag_aws-1.0.0/README.md +163 -0
  4. inventag_aws-1.0.0/inventag/__init__.py +77 -0
  5. inventag_aws-1.0.0/inventag/_python_version.py +31 -0
  6. inventag_aws-1.0.0/inventag/_version.py +6 -0
  7. inventag_aws-1.0.0/inventag/cli/__init__.py +12 -0
  8. inventag_aws-1.0.0/inventag/cli/config_validator.py +481 -0
  9. inventag_aws-1.0.0/inventag/cli/logging_setup.py +169 -0
  10. inventag_aws-1.0.0/inventag/cli/main.py +1266 -0
  11. inventag_aws-1.0.0/inventag/cli/safety.py +131 -0
  12. inventag_aws-1.0.0/inventag/compliance/__init__.py +52 -0
  13. inventag_aws-1.0.0/inventag/compliance/checker.py +722 -0
  14. inventag_aws-1.0.0/inventag/compliance/compliance_manager.py +526 -0
  15. inventag_aws-1.0.0/inventag/compliance/production_monitor.py +979 -0
  16. inventag_aws-1.0.0/inventag/compliance/security_validator.py +801 -0
  17. inventag_aws-1.0.0/inventag/core/__init__.py +50 -0
  18. inventag_aws-1.0.0/inventag/core/cicd_integration.py +1107 -0
  19. inventag_aws-1.0.0/inventag/core/cloud_bom_generator.py +1319 -0
  20. inventag_aws-1.0.0/inventag/core/credential_manager.py +922 -0
  21. inventag_aws-1.0.0/inventag/core/s3_upload.py +166 -0
  22. inventag_aws-1.0.0/inventag/discovery/__init__.py +109 -0
  23. inventag_aws-1.0.0/inventag/discovery/comprehensive_discovery.py +1549 -0
  24. inventag_aws-1.0.0/inventag/discovery/cost_analyzer.py +1326 -0
  25. inventag_aws-1.0.0/inventag/discovery/enhanced_readonly_discovery.py +606 -0
  26. inventag_aws-1.0.0/inventag/discovery/intelligent_discovery.py +1001 -0
  27. inventag_aws-1.0.0/inventag/discovery/inventory.py +3366 -0
  28. inventag_aws-1.0.0/inventag/discovery/network_analyzer.py +598 -0
  29. inventag_aws-1.0.0/inventag/discovery/optimized_discovery.py +1654 -0
  30. inventag_aws-1.0.0/inventag/discovery/optimized_dynamic_discovery.py +657 -0
  31. inventag_aws-1.0.0/inventag/discovery/security_analyzer.py +782 -0
  32. inventag_aws-1.0.0/inventag/discovery/service_descriptions.py +728 -0
  33. inventag_aws-1.0.0/inventag/discovery/service_enrichment.py +719 -0
  34. inventag_aws-1.0.0/inventag/discovery/service_filter.py +119 -0
  35. inventag_aws-1.0.0/inventag/discovery/service_handlers.py +798 -0
  36. inventag_aws-1.0.0/inventag/discovery/tag_mapping.py +650 -0
  37. inventag_aws-1.0.0/inventag/reporting/__init__.py +56 -0
  38. inventag_aws-1.0.0/inventag/reporting/bom_processor.py +1075 -0
  39. inventag_aws-1.0.0/inventag/reporting/branding_system.py +719 -0
  40. inventag_aws-1.0.0/inventag/reporting/configuration_manager.py +898 -0
  41. inventag_aws-1.0.0/inventag/reporting/converter.py +1662 -0
  42. inventag_aws-1.0.0/inventag/reporting/csv_builder.py +92 -0
  43. inventag_aws-1.0.0/inventag/reporting/document_generator.py +635 -0
  44. inventag_aws-1.0.0/inventag/reporting/excel_branding_applicator.py +582 -0
  45. inventag_aws-1.0.0/inventag/reporting/excel_builder.py +978 -0
  46. inventag_aws-1.0.0/inventag/reporting/report_template.py +1620 -0
  47. inventag_aws-1.0.0/inventag/reporting/template_framework.py +816 -0
  48. inventag_aws-1.0.0/inventag/reporting/word_branding_applicator.py +569 -0
  49. inventag_aws-1.0.0/inventag/reporting/word_builder.py +1017 -0
  50. inventag_aws-1.0.0/inventag/security/__init__.py +30 -0
  51. inventag_aws-1.0.0/inventag/security/arn.py +114 -0
  52. inventag_aws-1.0.0/inventag/security/iam_policy.py +216 -0
  53. inventag_aws-1.0.0/inventag/security/read_only_guard.py +287 -0
  54. inventag_aws-1.0.0/inventag/security/redaction.py +233 -0
  55. inventag_aws-1.0.0/inventag/security/safe_output.py +190 -0
  56. inventag_aws-1.0.0/inventag/state/__init__.py +16 -0
  57. inventag_aws-1.0.0/inventag/state/changelog_generator.py +1362 -0
  58. inventag_aws-1.0.0/inventag/state/delta_detector.py +1411 -0
  59. inventag_aws-1.0.0/inventag/state/state_manager.py +514 -0
  60. inventag_aws-1.0.0/inventag/templating/__init__.py +37 -0
  61. inventag_aws-1.0.0/inventag/templating/builtin/ci-pipeline.yaml +18 -0
  62. inventag_aws-1.0.0/inventag/templating/builtin/executive-summary.yaml +20 -0
  63. inventag_aws-1.0.0/inventag/templating/builtin/finops-cost-allocation.yaml +25 -0
  64. inventag_aws-1.0.0/inventag/templating/builtin/finops-cost-report.yaml +17 -0
  65. inventag_aws-1.0.0/inventag/templating/builtin/org-multi-account.yaml +33 -0
  66. inventag_aws-1.0.0/inventag/templating/builtin/security-baseline.yaml +20 -0
  67. inventag_aws-1.0.0/inventag/templating/builtin/single-account.yaml +15 -0
  68. inventag_aws-1.0.0/inventag/templating/builtin/standard-bom.yaml +42 -0
  69. inventag_aws-1.0.0/inventag/templating/cli.py +301 -0
  70. inventag_aws-1.0.0/inventag/templating/columns.py +180 -0
  71. inventag_aws-1.0.0/inventag/templating/errors.py +42 -0
  72. inventag_aws-1.0.0/inventag/templating/loader.py +255 -0
  73. inventag_aws-1.0.0/inventag/templating/reference.py +104 -0
  74. inventag_aws-1.0.0/inventag/templating/registry.py +410 -0
  75. inventag_aws-1.0.0/inventag/templating/render_excel.py +228 -0
  76. inventag_aws-1.0.0/inventag/templating/render_word.py +258 -0
  77. inventag_aws-1.0.0/inventag/templating/runner.py +368 -0
  78. inventag_aws-1.0.0/inventag/templating/schema.py +816 -0
  79. inventag_aws-1.0.0/inventag/templating/tag_policy.py +174 -0
  80. inventag_aws-1.0.0/inventag/timeutil.py +59 -0
  81. inventag_aws-1.0.0/inventag_aws.egg-info/PKG-INFO +202 -0
  82. inventag_aws-1.0.0/inventag_aws.egg-info/SOURCES.txt +91 -0
  83. inventag_aws-1.0.0/inventag_aws.egg-info/dependency_links.txt +1 -0
  84. inventag_aws-1.0.0/inventag_aws.egg-info/entry_points.txt +2 -0
  85. inventag_aws-1.0.0/inventag_aws.egg-info/requires.txt +12 -0
  86. inventag_aws-1.0.0/inventag_aws.egg-info/top_level.txt +1 -0
  87. inventag_aws-1.0.0/pyproject.toml +49 -0
  88. inventag_aws-1.0.0/requirements.txt +22 -0
  89. inventag_aws-1.0.0/setup.cfg +4 -0
  90. inventag_aws-1.0.0/tests/test_aws_resource_inventory.py +173 -0
  91. inventag_aws-1.0.0/tests/test_billing_fallback.py +43 -0
  92. inventag_aws-1.0.0/tests/test_bom_converter.py +160 -0
  93. inventag_aws-1.0.0/tests/test_python_compatibility.py +183 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 InvenTag Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,202 @@
1
+ Metadata-Version: 2.4
2
+ Name: inventag-aws
3
+ Version: 1.0.0
4
+ Summary: AWS resource inventory, tag compliance checks, and Excel/Word BOM reports. Read-only.
5
+ Author: InvenTag Contributors
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://habhabhabs.github.io/inventag-aws/
8
+ Project-URL: Documentation, https://habhabhabs.github.io/inventag-aws/docs/
9
+ Project-URL: Source, https://github.com/habhabhabs/inventag-aws
10
+ Project-URL: Issues, https://github.com/habhabhabs/inventag-aws/issues
11
+ Project-URL: Changelog, https://github.com/habhabhabs/inventag-aws/blob/main/CHANGELOG.md
12
+ Keywords: aws,inventory,bom,tagging,compliance
13
+ Classifier: Development Status :: 5 - Production/Stable
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: System Administrators
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
22
+ Classifier: Topic :: System :: Systems Administration
23
+ Requires-Python: >=3.11
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: boto3>=1.35.0
27
+ Requires-Dist: PyYAML>=6.0
28
+ Requires-Dist: openpyxl>=3.0.0
29
+ Requires-Dist: python-docx>=0.8.11
30
+ Requires-Dist: psutil>=5.9.0
31
+ Requires-Dist: keyring>=24.0.0
32
+ Requires-Dist: cryptography>=50.0.0
33
+ Requires-Dist: requests>=2.33.0
34
+ Requires-Dist: urllib3>=2.8.0
35
+ Requires-Dist: certifi>=2026.10.18
36
+ Requires-Dist: idna>=3.15
37
+ Requires-Dist: lxml>=6.1.0
38
+ Dynamic: license-file
39
+
40
+ <p align="center">
41
+ <img src="https://raw.githubusercontent.com/habhabhabs/inventag-aws/main/website/static/img/logo-wordmark-readme.png" alt="InvenTag" width="331" height="96">
42
+ </p>
43
+
44
+ <p align="center">
45
+ <strong>Find out what is running in your AWS accounts, check it is tagged properly, and hand over an Excel or Word bill of materials.</strong>
46
+ </p>
47
+
48
+ [![Automated Release](https://github.com/habhabhabs/inventag-aws/workflows/Automated%20Release/badge.svg)](https://github.com/habhabhabs/inventag-aws/actions)
49
+ [![Documentation](https://github.com/habhabhabs/inventag-aws/workflows/Documentation%20Deployment/badge.svg)](https://habhabhabs.github.io/inventag-aws/)
50
+ [![PyPI](https://img.shields.io/pypi/v/inventag-aws.svg)](https://pypi.org/project/inventag-aws/)
51
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
52
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/habhabhabs/inventag-aws/blob/main/LICENSE)
53
+
54
+ **Install:** `pip install inventag-aws` ([PyPI](https://pypi.org/project/inventag-aws/))
55
+ **Docs:** <https://habhabhabs.github.io/inventag-aws/>
56
+
57
+ ## Quick start
58
+
59
+ Install from [PyPI](https://pypi.org/project/inventag-aws/) with pip:
60
+
61
+ ```bash
62
+ python3 -m venv .venv && source .venv/bin/activate
63
+ pip install inventag-aws
64
+
65
+ inventag --validate-credentials # uses your current AWS credentials
66
+ inventag --create-excel --verbose # -> bom_output/multi_account_bom_<timestamp>.xlsx
67
+ ```
68
+
69
+ To upgrade later, run `pip install --upgrade inventag-aws`. To work on the code
70
+ or run the newest unreleased version, install from source instead:
71
+
72
+ ```bash
73
+ git clone https://github.com/habhabhabs/inventag-aws.git
74
+ cd inventag-aws
75
+ python3 -m venv .venv && source .venv/bin/activate
76
+ pip install -r requirements.txt
77
+ inventag --validate-credentials
78
+ ```
79
+
80
+ Python 3.11 or later is required. Use a read-only IAM identity. By default, discovery made two
81
+ Cost Explorer requests for each account in our offline test, and AWS bills each
82
+ request. Add `--no-billing-validation` to make no Cost Explorer request.
83
+ Details:
84
+ [Installation](https://habhabhabs.github.io/inventag-aws/docs/getting-started/installation).
85
+
86
+ ## What it does
87
+
88
+ - **Discovery** across accounts and regions through the Resource Groups Tagging
89
+ API, per-service `List*`/`Describe*`/`Get*` calls (24 services have their own
90
+ discovery code) and Cost Explorer billing data.
91
+ - **Bill of materials** as an Excel workbook (`--create-excel`) and/or Word
92
+ document (`--create-word`), with your own tag columns (`--tag-mappings`) and
93
+ service descriptions (`--service-descriptions`).
94
+ - **Templates** (`--template`, `inventag templates list`): built-in and your own
95
+ report layouts, tag policies and run settings.
96
+ - **Layout files** (`--word-template`, `--excel-template`): a YAML or JSON
97
+ file selects the title, the sections or sheets, the columns, and the header
98
+ and footer text.
99
+ - **Several accounts** from a file (`--accounts-file`), interactively
100
+ (`--accounts-prompt`) or through an assumed role (`--cross-account-role`),
101
+ processed in parallel.
102
+ - **Change tracking**: each run saves a snapshot in `bom_output/state/`; from
103
+ the second run on, InvenTag writes a change report (`changelog_<timestamp>.md`)
104
+ of what was added, removed or changed.
105
+ - **Upload to Amazon S3** (`--s3-bucket`) with server-side encryption.
106
+ - **Read-only guard**: the CLI blocks each AWS API call that is not a read
107
+ operation. `--audit-output audit.json` writes a list of the calls.
108
+ - **Tag-policy checks** (required tags, allowed values) with a tag-policy
109
+ template, for example `--template finops-cost-allocation`. Results go to a Tag
110
+ Compliance sheet, a Word section and a JSON file, and a config template can
111
+ fail a CI job (exit code 3).
112
+
113
+ ### Limits
114
+
115
+ InvenTag has never been tested against a real AWS account; every test uses
116
+ mocked AWS. Global services (S3, IAM, CloudFront, Route 53) are scanned only if
117
+ `us-east-1` is among the regions. Tags on Lambda, RDS, DynamoDB, SQS and SNS
118
+ resources are not matched to the resource in our tests. One failed account does
119
+ not change the exit code. Read
120
+ [Current status and known limitations](https://habhabhabs.github.io/inventag-aws/docs/getting-started/status).
121
+
122
+ ### Not implemented
123
+
124
+ These flags stop the CLI with an error message and exit code `2`:
125
+ `--create-google-docs`, `--per-account-reports`, `--compliance-standard`,
126
+ `--risk-threshold` and `--disable-production-safety`. InvenTag does not certify
127
+ compliance with SOC 2 or other standards. For the full list, see
128
+ [Current status and known limitations](https://habhabhabs.github.io/inventag-aws/docs/getting-started/status).
129
+
130
+ ## More examples
131
+
132
+ ```bash
133
+ # Several accounts, Excel + Word, your own tag columns
134
+ inventag --accounts-file accounts.json \
135
+ --create-excel --create-word \
136
+ --tag-mappings config/defaults/mappings/tag_to_column_mappings_example.yaml \
137
+ --service-descriptions config/defaults/services/service_descriptions_example.yaml
138
+
139
+ # Assume a read-only role (full role ARN)
140
+ inventag --cross-account-role arn:aws:iam::123456789012:role/InvenTagReadOnly \
141
+ --create-excel
142
+
143
+ # Assume the same role name in each account of accounts.json
144
+ inventag --accounts-file accounts.json --cross-account-role InvenTagReadOnly \
145
+ --create-excel
146
+
147
+ # Upload the reports to S3 (server-side encrypted)
148
+ inventag --create-excel --s3-bucket my-reports-bucket
149
+
150
+ # Faster runs: fewer regions, more accounts in parallel
151
+ inventag --accounts-file accounts.json --create-excel \
152
+ --account-regions us-east-1,ap-southeast-1 --max-concurrent-accounts 8
153
+ ```
154
+
155
+ Every flag: [Command-line reference](https://habhabhabs.github.io/inventag-aws/docs/reference/cli).
156
+
157
+ ## Documentation
158
+
159
+ | Section | Link |
160
+ |---|---|
161
+ | Quick start | [docs/getting-started/quick-start.md](https://github.com/habhabhabs/inventag-aws/blob/main/docs/getting-started/quick-start.md) |
162
+ | Current status and known limitations | [docs/getting-started/status.md](https://github.com/habhabhabs/inventag-aws/blob/main/docs/getting-started/status.md) |
163
+ | Choose what to scan | [docs/guides/run-a-scan.md](https://github.com/habhabhabs/inventag-aws/blob/main/docs/guides/run-a-scan.md) |
164
+ | Command-line reference | [docs/reference/cli.md](https://github.com/habhabhabs/inventag-aws/blob/main/docs/reference/cli.md) |
165
+ | Configuration files | [docs/reference/configuration-files.md](https://github.com/habhabhabs/inventag-aws/blob/main/docs/reference/configuration-files.md) |
166
+ | Templates | [docs/templates/index.md](https://github.com/habhabhabs/inventag-aws/blob/main/docs/templates/index.md) |
167
+ | Read-only access and permissions | [docs/guides/read-only-access.md](https://github.com/habhabhabs/inventag-aws/blob/main/docs/guides/read-only-access.md) |
168
+ | Architecture | [docs/development/architecture.md](https://github.com/habhabhabs/inventag-aws/blob/main/docs/development/architecture.md) |
169
+ | Contributing | [docs/development/CONTRIBUTING.md](https://github.com/habhabhabs/inventag-aws/blob/main/docs/development/CONTRIBUTING.md) |
170
+
171
+ The same Markdown files are published as the documentation site (Docusaurus,
172
+ in `website/`). Brand assets (logo, favicon, social card) and the script that
173
+ regenerates them live in [`website/brand/`](https://github.com/habhabhabs/inventag-aws/blob/main/website/brand/README.md).
174
+
175
+ ## Project layout
176
+
177
+ ```text
178
+ inventag-aws/
179
+ ├── inventag_cli.py # CLI entry point (the `inventag` command runs it)
180
+ ├── inventag/ # Python package: cli, core, discovery, reporting, templating, state, security
181
+ ├── scripts/legacy/ # standalone scripts (inventory, tag compliance, BOM converter)
182
+ ├── config/ # example configs, IAM policy, JSON schemas
183
+ ├── examples/ # account files and CI examples
184
+ ├── docs/ # documentation (Markdown)
185
+ ├── website/ # Docusaurus site, brand assets
186
+ └── tests/
187
+ ```
188
+
189
+ ## Support
190
+
191
+ - [Issues](https://github.com/habhabhabs/inventag-aws/issues): bugs and feature requests
192
+ - [Discussions](https://github.com/habhabhabs/inventag-aws/discussions): questions
193
+
194
+ ## License
195
+
196
+ MIT. See [LICENSE](https://github.com/habhabhabs/inventag-aws/blob/main/LICENSE).
197
+
198
+ ---
199
+
200
+ *AWS is a trademark of Amazon.com, Inc. or its affiliates. InvenTag is an
201
+ independent tool and is not affiliated with, endorsed by, or sponsored by
202
+ Amazon Web Services, Inc.*
@@ -0,0 +1,163 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/habhabhabs/inventag-aws/main/website/static/img/logo-wordmark-readme.png" alt="InvenTag" width="331" height="96">
3
+ </p>
4
+
5
+ <p align="center">
6
+ <strong>Find out what is running in your AWS accounts, check it is tagged properly, and hand over an Excel or Word bill of materials.</strong>
7
+ </p>
8
+
9
+ [![Automated Release](https://github.com/habhabhabs/inventag-aws/workflows/Automated%20Release/badge.svg)](https://github.com/habhabhabs/inventag-aws/actions)
10
+ [![Documentation](https://github.com/habhabhabs/inventag-aws/workflows/Documentation%20Deployment/badge.svg)](https://habhabhabs.github.io/inventag-aws/)
11
+ [![PyPI](https://img.shields.io/pypi/v/inventag-aws.svg)](https://pypi.org/project/inventag-aws/)
12
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
13
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/habhabhabs/inventag-aws/blob/main/LICENSE)
14
+
15
+ **Install:** `pip install inventag-aws` ([PyPI](https://pypi.org/project/inventag-aws/))
16
+ **Docs:** <https://habhabhabs.github.io/inventag-aws/>
17
+
18
+ ## Quick start
19
+
20
+ Install from [PyPI](https://pypi.org/project/inventag-aws/) with pip:
21
+
22
+ ```bash
23
+ python3 -m venv .venv && source .venv/bin/activate
24
+ pip install inventag-aws
25
+
26
+ inventag --validate-credentials # uses your current AWS credentials
27
+ inventag --create-excel --verbose # -> bom_output/multi_account_bom_<timestamp>.xlsx
28
+ ```
29
+
30
+ To upgrade later, run `pip install --upgrade inventag-aws`. To work on the code
31
+ or run the newest unreleased version, install from source instead:
32
+
33
+ ```bash
34
+ git clone https://github.com/habhabhabs/inventag-aws.git
35
+ cd inventag-aws
36
+ python3 -m venv .venv && source .venv/bin/activate
37
+ pip install -r requirements.txt
38
+ inventag --validate-credentials
39
+ ```
40
+
41
+ Python 3.11 or later is required. Use a read-only IAM identity. By default, discovery made two
42
+ Cost Explorer requests for each account in our offline test, and AWS bills each
43
+ request. Add `--no-billing-validation` to make no Cost Explorer request.
44
+ Details:
45
+ [Installation](https://habhabhabs.github.io/inventag-aws/docs/getting-started/installation).
46
+
47
+ ## What it does
48
+
49
+ - **Discovery** across accounts and regions through the Resource Groups Tagging
50
+ API, per-service `List*`/`Describe*`/`Get*` calls (24 services have their own
51
+ discovery code) and Cost Explorer billing data.
52
+ - **Bill of materials** as an Excel workbook (`--create-excel`) and/or Word
53
+ document (`--create-word`), with your own tag columns (`--tag-mappings`) and
54
+ service descriptions (`--service-descriptions`).
55
+ - **Templates** (`--template`, `inventag templates list`): built-in and your own
56
+ report layouts, tag policies and run settings.
57
+ - **Layout files** (`--word-template`, `--excel-template`): a YAML or JSON
58
+ file selects the title, the sections or sheets, the columns, and the header
59
+ and footer text.
60
+ - **Several accounts** from a file (`--accounts-file`), interactively
61
+ (`--accounts-prompt`) or through an assumed role (`--cross-account-role`),
62
+ processed in parallel.
63
+ - **Change tracking**: each run saves a snapshot in `bom_output/state/`; from
64
+ the second run on, InvenTag writes a change report (`changelog_<timestamp>.md`)
65
+ of what was added, removed or changed.
66
+ - **Upload to Amazon S3** (`--s3-bucket`) with server-side encryption.
67
+ - **Read-only guard**: the CLI blocks each AWS API call that is not a read
68
+ operation. `--audit-output audit.json` writes a list of the calls.
69
+ - **Tag-policy checks** (required tags, allowed values) with a tag-policy
70
+ template, for example `--template finops-cost-allocation`. Results go to a Tag
71
+ Compliance sheet, a Word section and a JSON file, and a config template can
72
+ fail a CI job (exit code 3).
73
+
74
+ ### Limits
75
+
76
+ InvenTag has never been tested against a real AWS account; every test uses
77
+ mocked AWS. Global services (S3, IAM, CloudFront, Route 53) are scanned only if
78
+ `us-east-1` is among the regions. Tags on Lambda, RDS, DynamoDB, SQS and SNS
79
+ resources are not matched to the resource in our tests. One failed account does
80
+ not change the exit code. Read
81
+ [Current status and known limitations](https://habhabhabs.github.io/inventag-aws/docs/getting-started/status).
82
+
83
+ ### Not implemented
84
+
85
+ These flags stop the CLI with an error message and exit code `2`:
86
+ `--create-google-docs`, `--per-account-reports`, `--compliance-standard`,
87
+ `--risk-threshold` and `--disable-production-safety`. InvenTag does not certify
88
+ compliance with SOC 2 or other standards. For the full list, see
89
+ [Current status and known limitations](https://habhabhabs.github.io/inventag-aws/docs/getting-started/status).
90
+
91
+ ## More examples
92
+
93
+ ```bash
94
+ # Several accounts, Excel + Word, your own tag columns
95
+ inventag --accounts-file accounts.json \
96
+ --create-excel --create-word \
97
+ --tag-mappings config/defaults/mappings/tag_to_column_mappings_example.yaml \
98
+ --service-descriptions config/defaults/services/service_descriptions_example.yaml
99
+
100
+ # Assume a read-only role (full role ARN)
101
+ inventag --cross-account-role arn:aws:iam::123456789012:role/InvenTagReadOnly \
102
+ --create-excel
103
+
104
+ # Assume the same role name in each account of accounts.json
105
+ inventag --accounts-file accounts.json --cross-account-role InvenTagReadOnly \
106
+ --create-excel
107
+
108
+ # Upload the reports to S3 (server-side encrypted)
109
+ inventag --create-excel --s3-bucket my-reports-bucket
110
+
111
+ # Faster runs: fewer regions, more accounts in parallel
112
+ inventag --accounts-file accounts.json --create-excel \
113
+ --account-regions us-east-1,ap-southeast-1 --max-concurrent-accounts 8
114
+ ```
115
+
116
+ Every flag: [Command-line reference](https://habhabhabs.github.io/inventag-aws/docs/reference/cli).
117
+
118
+ ## Documentation
119
+
120
+ | Section | Link |
121
+ |---|---|
122
+ | Quick start | [docs/getting-started/quick-start.md](https://github.com/habhabhabs/inventag-aws/blob/main/docs/getting-started/quick-start.md) |
123
+ | Current status and known limitations | [docs/getting-started/status.md](https://github.com/habhabhabs/inventag-aws/blob/main/docs/getting-started/status.md) |
124
+ | Choose what to scan | [docs/guides/run-a-scan.md](https://github.com/habhabhabs/inventag-aws/blob/main/docs/guides/run-a-scan.md) |
125
+ | Command-line reference | [docs/reference/cli.md](https://github.com/habhabhabs/inventag-aws/blob/main/docs/reference/cli.md) |
126
+ | Configuration files | [docs/reference/configuration-files.md](https://github.com/habhabhabs/inventag-aws/blob/main/docs/reference/configuration-files.md) |
127
+ | Templates | [docs/templates/index.md](https://github.com/habhabhabs/inventag-aws/blob/main/docs/templates/index.md) |
128
+ | Read-only access and permissions | [docs/guides/read-only-access.md](https://github.com/habhabhabs/inventag-aws/blob/main/docs/guides/read-only-access.md) |
129
+ | Architecture | [docs/development/architecture.md](https://github.com/habhabhabs/inventag-aws/blob/main/docs/development/architecture.md) |
130
+ | Contributing | [docs/development/CONTRIBUTING.md](https://github.com/habhabhabs/inventag-aws/blob/main/docs/development/CONTRIBUTING.md) |
131
+
132
+ The same Markdown files are published as the documentation site (Docusaurus,
133
+ in `website/`). Brand assets (logo, favicon, social card) and the script that
134
+ regenerates them live in [`website/brand/`](https://github.com/habhabhabs/inventag-aws/blob/main/website/brand/README.md).
135
+
136
+ ## Project layout
137
+
138
+ ```text
139
+ inventag-aws/
140
+ ├── inventag_cli.py # CLI entry point (the `inventag` command runs it)
141
+ ├── inventag/ # Python package: cli, core, discovery, reporting, templating, state, security
142
+ ├── scripts/legacy/ # standalone scripts (inventory, tag compliance, BOM converter)
143
+ ├── config/ # example configs, IAM policy, JSON schemas
144
+ ├── examples/ # account files and CI examples
145
+ ├── docs/ # documentation (Markdown)
146
+ ├── website/ # Docusaurus site, brand assets
147
+ └── tests/
148
+ ```
149
+
150
+ ## Support
151
+
152
+ - [Issues](https://github.com/habhabhabs/inventag-aws/issues): bugs and feature requests
153
+ - [Discussions](https://github.com/habhabhabs/inventag-aws/discussions): questions
154
+
155
+ ## License
156
+
157
+ MIT. See [LICENSE](https://github.com/habhabhabs/inventag-aws/blob/main/LICENSE).
158
+
159
+ ---
160
+
161
+ *AWS is a trademark of Amazon.com, Inc. or its affiliates. InvenTag is an
162
+ independent tool and is not affiliated with, endorsed by, or sponsored by
163
+ Amazon Web Services, Inc.*
@@ -0,0 +1,77 @@
1
+ """
2
+ InvenTag - Unified AWS Cloud Governance Platform
3
+
4
+ A comprehensive Python package for AWS resource discovery, compliance checking,
5
+ professional BOM (Bill of Materials) document generation, and state management
6
+ with advanced change tracking capabilities.
7
+
8
+ This package transforms the proven functionality from standalone scripts into
9
+ a unified, enterprise-grade platform suitable for both CLI usage and service deployment.
10
+ """
11
+
12
+ # Must stay first: fails with a plain message on Python older than 3.11.
13
+ from ._python_version import MIN_PYTHON, check_python_version
14
+
15
+ check_python_version()
16
+
17
+ from ._version import __version__
18
+
19
+ __author__ = "InvenTag Team"
20
+
21
+ # Core modules
22
+ from .discovery import AWSResourceInventory
23
+ from .compliance import ComprehensiveTagComplianceChecker
24
+ from .reporting import BOMConverter
25
+
26
+ # Analysis modules
27
+ from .discovery.network_analyzer import NetworkAnalyzer
28
+
29
+ # State management modules
30
+ from .state import StateManager, DeltaDetector, ChangelogGenerator
31
+
32
+ # Main orchestrator
33
+ from .core import (
34
+ CloudBOMGenerator,
35
+ MultiAccountConfig,
36
+ AccountContext,
37
+ AccountCredentials,
38
+ CredentialManager,
39
+ CredentialValidationResult,
40
+ CICDIntegration,
41
+ S3UploadConfig,
42
+ ComplianceGateConfig,
43
+ NotificationConfig,
44
+ PrometheusConfig,
45
+ PrometheusMetrics,
46
+ CICDResult,
47
+ )
48
+
49
+ # CLI components
50
+ from .cli import main as cli_main, create_parser, ConfigValidator, setup_logging
51
+
52
+ __all__ = [
53
+ "AWSResourceInventory",
54
+ "ComprehensiveTagComplianceChecker",
55
+ "BOMConverter",
56
+ "NetworkAnalyzer",
57
+ "StateManager",
58
+ "DeltaDetector",
59
+ "ChangelogGenerator",
60
+ "CloudBOMGenerator",
61
+ "MultiAccountConfig",
62
+ "AccountContext",
63
+ "AccountCredentials",
64
+ "CredentialManager",
65
+ "CredentialValidationResult",
66
+ "CICDIntegration",
67
+ "S3UploadConfig",
68
+ "ComplianceGateConfig",
69
+ "NotificationConfig",
70
+ "PrometheusConfig",
71
+ "PrometheusMetrics",
72
+ "CICDResult",
73
+ "cli_main",
74
+ "create_parser",
75
+ "ConfigValidator",
76
+ "setup_logging",
77
+ ]
@@ -0,0 +1,31 @@
1
+ """
2
+ Minimum supported Python version.
3
+
4
+ This module is imported first by ``inventag/__init__.py``. Keep it free of
5
+ syntax newer than Python 2.7 / 3.0 (no f-strings, no annotations), so that an
6
+ old interpreter reaches the plain error message below instead of failing with
7
+ a SyntaxError somewhere else in the package.
8
+ """
9
+
10
+ import sys
11
+
12
+ MIN_PYTHON = (3, 11)
13
+
14
+
15
+ def unsupported_python_message(version_info=None):
16
+ """Return an error message if ``version_info`` is too old, else ``None``."""
17
+ version_info = sys.version_info if version_info is None else version_info
18
+ if tuple(version_info[:2]) >= MIN_PYTHON:
19
+ return None
20
+ return (
21
+ "InvenTag requires Python %d.%d or later; this interpreter is Python %d.%d. "
22
+ "Install a newer Python (https://www.python.org/downloads/) and run "
23
+ "InvenTag with it." % (MIN_PYTHON + tuple(version_info[:2]))
24
+ )
25
+
26
+
27
+ def check_python_version(version_info=None):
28
+ """Raise ``ImportError`` with a plain message on an unsupported Python."""
29
+ message = unsupported_python_message(version_info)
30
+ if message:
31
+ raise ImportError(message)
@@ -0,0 +1,6 @@
1
+ """Single source of the InvenTag version.
2
+
3
+ The release workflow rewrites this file. pyproject.toml reads it at build time.
4
+ """
5
+
6
+ __version__ = "1.0.0"
@@ -0,0 +1,12 @@
1
+ """
2
+ Command Line Interface for InvenTag
3
+
4
+ Comprehensive CLI with multi-account support, format-specific options,
5
+ S3 upload capabilities, and extensive configuration management.
6
+ """
7
+
8
+ from .main import main, create_parser
9
+ from .config_validator import ConfigValidator
10
+ from .logging_setup import setup_logging
11
+
12
+ __all__ = ["main", "create_parser", "ConfigValidator", "setup_logging"]