See it as a diagram
Everything below, as a diagram you can edit. Describe yours and see it in seconds.
No account needed · Editable canvas, not a picture
The rule: a node earns its place by changing a decision
If knowing that a thing exists changes what a reader would do, it is architecture. If it does not, it is inventory. A database earns a box because you route around it, size it, back it up, and worry about it. A role assignment that grants that database access to a managed identity changes no reader decision on its own, so it is inventory: real, necessary, not a box.
Applied consistently the rule produces four keepers. Things that hold state (databases, storage, queues, catalogs). Things that serve or compute (clusters, functions, gateways, workspaces). Boundaries (network, resource group, module, account), because boundaries are where permission and blast radius change. And direction, because an architecture diagram without arrows is an inventory with a layout.
Datadef applies that rule as a fixed classification rather than a judgment call, so the same repository produces the same exclusions every time. A resource type whose name contains role, permission, grant, policy_attachment, member, iam, entitlement, or acl is wiring. So is anything matching secret, certificate, key_vault, kms, or credential. So is every resource of the random, null, local, time, tls, archive, template, and external providers, which is why a random_id suffix never becomes a box. On a real azurerm or AWS platform repo those categories outnumber the infrastructure.
Counted, not deleted
The objection to leaving things out is that the diagram becomes incomplete. The answer is to count instead of delete, so nothing disappears silently. Datadef does this deterministically during the parse rather than leaving it to taste: major resources stay individual nodes with their provider icons; a repeated minor type inside a module collapses into one node carrying the count and the member names, like Storage credentials x2: external, root; and glue is summarized in a note that says, for example, 18 wiring resources not worth boxes: 8 grants, 6 permissions, 4 role assignments.
The three numbers from the repository this curation was tuned against are worth stating, because they are the whole argument. 123 declared resources. 62 left once wiring is excluded, which is what a first completeness pass drew, and which produced a correct and unreadable phone-book column. About 36 once repeated types are rolled up.
There are hard budgets behind it, and they run in two passes. The first pass draws major resources individually, rolls repeated minor types into one node each, and lets a module keep up to eight nodes before its remaining singles fold into a Supporting resources node carrying the count. If the canvas still exceeds the target of forty nodes, the whole plan is rebuilt in a strict pass where lone minors fold too. The target rises for repositories made of many small independent stacks: above eight stacks it becomes five nodes per stack, capped at seventy-two. The 123-resource platform repo this was built against lands at roughly 36 nodes, which is a diagram a person reads in one sitting.
DRAW databases, storage accounts, clusters, workspaces, gateways,
queues, catalogs, VPCs and resource groups as boundaries
COUNT repeated minor types (subnets x6, storage credentials x2),
overflow singles as "Supporting resources x9"
NOTE matched by name: role, permission, grant, policy_attachment,
member, iam, entitlement, acl, secret, certificate, kms,
credential; plus every random_*, null_*, tls_* resource
TABLE the full inventory, one row per module, in the generated docWhere the excluded detail goes
Nothing should be excluded without a destination. Inputs and outputs go to terraform-docs. The full inventory goes to the generated module reference table, one row per module with source and resource count, which sits in the same architecture doc as the diagram. Naming conventions and unmanaged resources go to the README, because they are not in the code at all.
Keeping the diagram and the inventory in the same generated artifact is what makes the exclusion safe: a reader who wants the missing role assignment scrolls down rather than opening a repo. See what a docs-as-code pipeline can and cannot hold for the trade-off in the other direction.
FAQ
Should IAM roles and policies appear in an architecture diagram?
How many boxes should an infrastructure diagram have?
Does an audit require every resource to be drawn?
Do tags and naming conventions belong on the diagram?
Should one diagram cover all environments?