Overview
Terraform Explorer is a feature available from Terraform Enterprise (TFE) version 1.0.x and later, designed to allow administrators and users to query Terraform state data across workspaces and resources. Explorer indexes Terraform state into a dedicated PostgreSQL database and provides an efficient query interface.
This article explains how to enable Terraform Explorer in a Docker Compose–based deployment, along with system requirements, setup steps, and validation procedures.
Requirements
Terraform Explorer is supported only in the following deployment modes:
- External Services (Mounted Disk is not supported)
- Active-Active Deployments
Not Supported:
- Mounted Disk Mode
- Pre-1.0.x versions of Terraform Enterprise
To enable Explorer, you must also provision a separate PostgreSQL database that Explorer will use to index Terraform state.
Prerequisites
Before enabling Terraform Explorer, ensure:
- You are running TFE v1.0.x or above
- TFE is deployed in External Services mode or Active-Active
- PostgreSQL database (AWS RDS or self-hosted) is available
- Network access exists between TFE nodes and the PostgreSQL host
- You can edit and restart the TFE deployment (compose.yaml or helm/override values for K8s)
Step 1 — Create the Explorer Database
Terraform Explorer requires its own dedicated database. You may:
Option A: Create a new PostgreSQL instance
This isolates Explorer indexing from TFE’s primary database.
Option B: Create a new database on the existing RDS PostgreSQL instance
Example:
CREATE DATABASE tfe_explorer;Ensure the DB user has appropriate privileges:
GRANT ALL PRIVILEGES ON DATABASE tfe_explorer TO postgres;
Step 2 — Add Explorer Configuration to compose.yaml
Edit the compose.yaml for your TFE Docker deployment and add the following environment variables under the terraform-enterprise service:
environment:
# Enable Terraform Explorer
TFE_EXPLORER_DATABASE_HOST: "example.ap-south-1.rds.amazonaws.com"
TFE_EXPLORER_DATABASE_NAME: "tfe_explorer"
TFE_EXPLORER_DATABASE_USER: "postgres"
TFE_EXPLORER_DATABASE_PASSWORD: "<password>"
TFE_EXPLORER_DATABASE_PARAMETERS: "sslmode=require"
Step 3 — Restart Terraform Enterprise
After updating the configuration:
docker compose down
docker compose up -d
During startup, Terraform Enterprise will automatically:
- Connect to the Explorer database
- Initialize Explorer schema
- Begin indexing workspace state data
Step 4 — Validate Terraform Explorer
Once TFE is back online:
- Log in to the TFE UI
- Locate Explorer in the left navigation panel
- Run a sample query
Example queries include filtering by:
- Workspace
- Provider
- Resource type
- Module
If indexing is completed successfully, results will appear in the Explorer UI.
References:
https://developer.hashicorp.com/terraform/enterprise/1.0.x/deploy/configuration/enable-explorer