Example: inventory every account in an organization
Goal: one report that covers all your accounts, with an Account column and a tag check.
You need:
- a role with the same name (here
InvenTagReadOnly) in every account, with a read-only policy; - credentials for an identity that may assume those roles, for example in the management account or a delegated security account.
Template
List your accounts:
Terminal
aws organizations list-accounts --query "Accounts[?Status=='ACTIVE'].[Id,Name]" --output text
Copy the built-in template and put your accounts in it:
Terminal
inventag templates init org-multi-account --output .inventag/templates/our-org.yaml
.inventag/templates/our-org.yaml
format_version: 1
kind: config
name: our-org
description: Every active account, read-only
spec:
accounts:
- account_id: "111111111111"
account_name: Production
role_arn: arn:aws:iam::111111111111:role/InvenTagReadOnly
- account_id: "222222222222"
account_name: Staging
role_arn: arn:aws:iam::222222222222:role/InvenTagReadOnly
- account_id: "333333333333"
account_name: Shared services
role_arn: arn:aws:iam::333333333333:role/InvenTagReadOnly
regions: [us-east-1]
outputs: [excel, word]
report_template: standard-bom
tag_policy: finops-cost-allocation
max_concurrent_accounts: 4
Command
Terminal
inventag templates validate our-org
inventag --template our-org
Output
While the placeholder IDs are still there, validate warns you:
Output
WARNING ~/acme-infra/.inventag/templates/our-org.yaml: account IDs 111111111111, 222222222222, 333333333333 look like placeholders; replace them with your own
OK ~/acme-infra/.inventag/templates/our-org.yaml (config 'our-org')
The run, with one sample bucket in each of the three made-up accounts:
Output
Wrote bom_output/tag_compliance_20261112_090000.json
Wrote bom_output/multi_account_bom_20261112_090000.docx
Wrote bom_output/multi_account_bom_20261112_090000.xlsx
Tag policy 'finops-cost-allocation': 0 of 39 resources compliant (0.0%), 39 non-compliant, 42 out of scope.
Sheets: Summary, ATHENA, EVENTS, KMS, S3, VPC, Tag Compliance
Summary sheet:
AWS Resource Inventory
Bill of materials generated by InvenTag
Generated: 2026-11-12 09:00 UTC
Accounts: 3 Regions: 1
| Service | Resources | Share |
|---|---|---|
| ATHENA | 3 | 3.7% |
| EVENTS | 3 | 3.7% |
| KMS | 42 | 51.9% |
| S3 | 3 | 3.7% |
| VPC | 30 | 37.0% |
| Total | 81 | 100.0% |
Sheets: Summary, ATHENA, EVENTS, KMS, S3, VPC, Tag Compliance
S3 sheet, first rows:
| Account | Region | Service | Type | Name | ID | ARN | ... |
|---|---|---|---|---|---|---|---|
| 111111111111 | us-east-1 | S3 | Bucket | acme-production-artifacts | acme-production-artifacts | arn:aws:s3:::acme-production-artifacts | ... |
| 333333333333 | us-east-1 | S3 | Bucket | acme-shared-services-artifacts | acme-shared-services-artifacts | arn:aws:s3:::acme-shared-services-artifacts | ... |
| 222222222222 | us-east-1 | S3 | Bucket | acme-staging-artifacts | acme-staging-artifacts | arn:aws:s3:::acme-staging-artifacts | ... |
The sheet has 9 columns; the first 7 are shown.
Next steps
- If an account fails, InvenTag logs the error, reports the others and still
exits with code 0, so check the log. The usual cause is the role's trust
policy. Add
--fail-on-account-errorto exit with code 5 instead, after the reports are written. If every account fails, the run exits with code 1. - An account that runs out of time keeps the resources found before the limit.
After a run where some accounts failed, run the same command again with
--resumeto scan only the others (the finished accounts are reused). - Scan several accounts explains the tuning options.