Skip to main content

Hashicorp Terraform File

HashiCorp Terraform File is a local file-based data source for infrastructure-as-code that enables reading and managing file content within Terraform configurations and state management. This product provides access to Terraform configuration files, state files, variable definitions, and module documentation stored on local filesystems or remote backends.

CategoryInfrastructure as code
DirectionQuery source
Sign-inNo Authentication
Query languagesSQLite
Tables7
Websitehashicorp.com

Before you start​

Hashicorp Terraform File needs no credentials — Huntbase queries it without signing in.

Watch out for
  • Binary plan files aren't read. Convert each plan to JSON with terraform show -json first.
  • For private Git repositories, if the github.com/... format doesn't work, try git::ssh://[email protected]/<org>/<repo>//*.tf.
  • Private S3 buckets need AWS credentials that have s3:ListBucket, s3:GetObject and s3:GetObjectVersion.

Connect Hashicorp Terraform File​

  1. Go to Connections and click New connection, or click New connection on the Hashicorp Terraform File product page.
  2. On Product, pick Hashicorp Terraform File and choose the Owner.
  3. On Details, give the connection a Name and, optionally, a Description.
  4. On Connect, fill in the settings and credentials described below.
  5. On Verify, review the summary and click Create & check.

For everything else on the setup page — saving a draft, I'll do this later, and what each check result means — see Connections.

Settings​

Where your Hashicorp Terraform File lives:

FieldRequiredNotes
Configuration File PathsNoLocations of .tf files. Each entry can be a Git URL such as github.com/<org>/<repo>//**/*.tf or an S3 URL such as s3::https://<bucket>.s3.<region>.amazonaws.com/<folder>//*.tf. Wildcards and ** are supported.
Plan File PathsNoLocations of plans in JSON format, such as *.tfplan.json. To create one, run terraform show -json tfplan > tfplan.json.
State File PathsNoLocations of state files, such as *.tfstate.

Credentials​

The only Method is No Authentication. Enter a Credential label (for example Production), then fill in:

No fields — choose this method to connect without credentials.

Query it​

Once connected, Hashicorp Terraform File can serve these languages in a query tab, and Scout can use it when you ask in Auto:

LanguageUse it for
SQLiteSQL over the 7 tables listed below, alongside every other connected source.

Tables​

Hashicorp Terraform File adds 7 tables. Browse their columns from Schema in the query bar's ⋯ menu.

All 7 tables
TableContains
terraform_data_sourceTerraform data source information.
terraform_localTerraform local information.
terraform_moduleTerraform module information.
terraform_outputTerraform output information.
terraform_providerTerraform provider information.
terraform_resourceTerraform resource information.
terraform_variableTerraform variable information.

Next steps​