Inventory

Inventory provides a complete catalog of your Terraform-managed infrastructure. Browse resources, modules, and types. Query your data with MQL. Build dashboards and find resources that aren't managed by Terraform.

Features

Browse Resources

Query & Analyze

In the Stategraph UI, the Inventory section is accessible from the left sidebar. It provides:

Inventory
├── Instances    → Browse all resource instances
├── Modules      → View Terraform modules
├── Types        → Resources by type
├── Query        → Run MQL queries
├── Dashboards   → Custom dashboard views
└── Gap Analysis → Unmanaged resource detection

Use Cases

Infrastructure Catalog

Use Inventory as your infrastructure CMDB:

  • Centralized view of all Terraform-managed resources
  • Search and filter across all states and workspaces
  • View resource attributes and dependencies
  • Track resource counts by type, module, or provider

Compliance & Auditing

  • Query resources by tags or attributes
  • Find resources missing required tags
  • Identify resources by region or account
  • Generate reports for compliance reviews

Resource Discovery

  • Find resources across multiple Terraform states
  • Identify duplicate or similar resources
  • Discover resources by naming patterns
  • Gap analysis to find unmanaged resources

Quick Examples

Find all EC2 instances

Navigate to Types and select aws_instance, or run this query:

SELECT address, attributes->>'instance_type' AS instance_type
FROM instances
WHERE resource_type = 'aws_instance'

Count resources by type

SELECT type, count(*) AS count
FROM resources
GROUP BY type
ORDER BY type

Find untagged resources

SELECT address
FROM instances
WHERE attributes->'tags' IS NULL
  OR attributes->>'tags' = '{}'

Getting Started

  1. Deploy Stategraph if you haven't already
  2. Set up Velocity to populate inventory
  3. Browse Instances to see your resources
  4. Try a Query to explore your data

Next Steps