Scan several accounts
Who this is for: you look after more than one AWS account and want one consolidated report.
What you can do after reading: list your accounts once and scan them all in one run.
How it works
InvenTag reads a list of accounts. For each one it gets credentials, either from a named AWS CLI profile or by assuming an IAM role from the identity you run it with. It scans each account, up to four at a time by default, and writes one report with an Account column.
InvenTag does not list the accounts in your AWS Organization for you. You write the list.
Create a read-only role in every account
Follow Set up read-only access.
Use the same role name everywhere, for example InvenTagReadOnly.
Get your account list
From the management account, or a delegated administrator account:
aws organizations list-accounts \
--query "Accounts[?Status=='ACTIVE'].[Id,Name]" --output text
Write the list as a config template
inventag templates init org-multi-account --output .inventag/templates/our-org.yaml
Edit the accounts section. Each account needs its 12-digit ID in quotes
and either a role_arn or a profile_name:
spec:
accounts:
- account_id: "123456789012"
account_name: Production
role_arn: arn:aws:iam::123456789012:role/InvenTagReadOnly
- account_id: "210987654321"
account_name: Development
profile_name: dev-readonly
regions: [us-east-1, eu-west-1]
Check it, then run it:
inventag templates validate our-org
inventag --template our-org
validate catches the common mistakes: unquoted account IDs, a role ARN that
points at a different account than account_id, and access keys in the file
(not allowed in templates). With the placeholder IDs still in place it says
(sample data):
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')
A run across the three sample accounts:
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 36 resources compliant (0.0%), 36 non-compliant, 42 out of scope.
Sheets: Summary, 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 |
|---|---|---|
| EVENTS | 3 | 3.8% |
| KMS | 42 | 53.8% |
| S3 | 3 | 3.8% |
| VPC | 30 | 38.5% |
| Total | 78 | 100.0% |
Or use an accounts file
The --accounts-file option also works, and it accepts access keys (avoid
them if you can). If every account uses the same role name, you don't need to
write each ARN:
inventag --accounts-file accounts.yaml --cross-account-role InvenTagReadOnly --create-excel
The accounts file format is in Configuration files.
inventag --accounts-file accounts.yaml --create-excel
Tune the run
| Setting | Config template field | Flag |
|---|---|---|
| Accounts scanned at once (default 4) | max_concurrent_accounts | --max-concurrent-accounts |
| Seconds allowed per account (default 1800) | account_processing_timeout | --account-processing-timeout |
| One account at a time | parallel_processing: false | --disable-parallel-processing |
If one account fails, for example because its role cannot be assumed,
InvenTag logs the error and reports the accounts that worked. It does not
fall back to your default credentials for that account. The run still exits
with code 0, and the report does not name the missing account. Search the
log for Failed to establish context for account. If every account fails, the
run exits with code 1 and writes no report.