Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Resource Mapping

Resource Mapping explains how entries in a state file become rows in the resource inventory.

What is counted

RuleBehaviour
modeOnly managed resources are counted; data sources are ignored
InstancesEach element of instances counts as one resource, so count and for_each expansions are exact
TypeThe Terraform type (for example aws_s3_bucket) is matched to a cloud service in the dataset
Unmatched typesSkipped, and listed in tfstate_manifest.json under unmapped_types

Terraform types with no matching service are usually glue resources that do not represent billable infrastructure — aws_s3_bucket_versioning and azurerm_storage_container are typical examples. Seeing them in the manifest is expected.

Location resolution

Each instance is assigned a location using the first rule that produces a value:

OrderSourceNotes
1region attribute (AWS) or location attribute (Azure)Lowercased and trimmed
2The resource’s own arnAWS only; the region is field 4 of the ARN
3unknownNothing usable was found

AWS providers only write region onto a few resource types, so most AWS resources resolve through their ARN. Referenced ARNs such as stream_arn or kms_key_arn are never used — they can point at a resource in another region or account.

Global services such as IAM and Route53 carry no region in their ARNs and are grouped under unknown.