Compare Terraform with what is running

The Terraform section shows your state files, how each declared resource compares with your inventory, and which resources nobody manages with Terraform.

2 min read

Before you start

State sources
Add the S3 locations of your state files under Organization → Integrations → Terraform. Without a source the section is empty.

Overview

The Terraform overview: state sources, synced states, unmanaged and duplicated resources.
Terraform coverage
Configurations is how many S3 state sources are set up; Synced States, how many state files were read.
Unmanaged
How many resources were created manually, because they are in no state. All managed by Terraform when there are none.
Duplicated
How many resources are declared in more than one state.

States

The synced Terraform states, grouped by configuration.
Sync from S3
Fetches the latest state files from your sources. It runs in the background: use it after adding or changing a source.
Configure sources
Takes you to where the S3 locations are added or edited.
State list
The states found, grouped by configuration, with their bucket, key, last sync and number of resources. Open one to compare it with your inventory.
State detail
Where the state comes from (bucket, key, workspace), when it was last synced, and each Terraform resource compared with your inventory: Matched when it is identical, Modified (with the fields that differ), Missing when it is not found in the inventory, or Not inventoried when it is of a type we do not inventory.

Unmanaged

Resources that exist in your cloud but are declared in no state, most likely created by hand.

Unmanaged resources: found in the inventory but in no Terraform state.
What to do
Search by id or name, group them by type and bring them under Terraform. Nothing else is changed: the list only reports.

Duplicated

Resources declared in more than one state at once.

Duplicated resources: declared in more than one Terraform state.
What it means
A possible sign of a stale or misconfigured state. Click a state to inspect it. When a resource is in several states, the one with the lowest priority number is the one it counts for.