Skip to content
Calcrivo

Terraform Resource Count Calculator

Calculate total managed resources across providers, combining managed resources and data sources.

Inputs

resources

Resources managed via the AWS provider.

resources

Resources managed via the Azure provider.

resources

Resources managed via other providers (GCP, Kubernetes, DNS, etc.).

data sources

Read-only data source lookups referenced in the configuration.

Total Resources

215resources

Managed Resources

185resources

AWS Share

64.9%

Azure Share

21.6%

Other Providers Share

13.5%

Data Source Ratio

14.0%

Step by step

  1. Managed resources total

    120 + 40 + 25

    = 185 resources

  2. Total = managed + data sources

    185 + 30

    = 215 resources

How it works

Total Terraform footprint combines actively managed resources (things Terraform creates, updates and destroys) with data sources (read-only lookups of existing infrastructure). Formula: total = managed + data_sources. Breaking managed resources down per-provider shows where infrastructure complexity concentrates, which is useful for prioritizing module refactors or provider version upgrade risk.

Formula

total = managed_aws + managed_azure + managed_other + data_sources

managed_aws
AWS provider managed resources
managed_azure
Azure provider managed resources
managed_other
Other provider managed resources
data_sources
Read-only data source lookups

Frequently Asked Questions

Why separate managed resources from data sources?

Data sources don't get created, updated or destroyed by Terraform — they're read-only lookups (e.g. `data "aws_ami"`). Counting them separately avoids overstating your actual managed infrastructure footprint.

How do I get this breakdown from a real state file?

Run `terraform state list` and parse resource addresses by their `provider.resource_type` prefix, or use `terraform show -json` and aggregate programmatically by the `provider_name` field.

Does a high data source ratio indicate a problem?

Not inherently — heavy use of data sources is common in configurations that reference shared/pre-existing infrastructure (VPCs, AMIs, shared IAM roles) rather than owning everything end-to-end.

How does provider concentration affect risk?

A provider holding a large share of your resources means a provider version upgrade, API deprecation, or outage there has outsized blast radius — worth tracking alongside module dependency depth.

You might also need