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.
| Category | Infrastructure as code |
| Direction | Query source |
| Sign-in | No Authentication |
| Query languages | SQLite |
| Tables | 7 |
| Website | hashicorp.com |
Before you start
Hashicorp Terraform File needs no credentials — Huntbase queries it without signing in.
- Binary plan files aren't read. Convert each plan to JSON with
terraform show -jsonfirst. - For private Git repositories, if the
github.com/...format doesn't work, trygit::ssh://[email protected]/<org>/<repo>//*.tf. - Private S3 buckets need AWS credentials that have
s3:ListBucket,s3:GetObjectands3:GetObjectVersion.
Connect Hashicorp Terraform File
- Go to Connections and click New connection, or click New connection on the Hashicorp Terraform File product page.
- On Product, pick Hashicorp Terraform File and choose the Owner.
- On Details, give the connection a Name and, optionally, a Description.
- On Connect, fill in the settings and credentials described below.
- 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:
| Field | Required | Notes |
|---|---|---|
| Configuration File Paths | No | Locations 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 Paths | No | Locations of plans in JSON format, such as *.tfplan.json. To create one, run terraform show -json tfplan > tfplan.json. |
| State File Paths | No | Locations 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:
| Language | Use it for |
|---|---|
| SQLite | SQL 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
| Table | Contains |
|---|---|
terraform_data_source | Terraform data source information. |
terraform_local | Terraform local information. |
terraform_module | Terraform module information. |
terraform_output | Terraform output information. |
terraform_provider | Terraform provider information. |
terraform_resource | Terraform resource information. |
terraform_variable | Terraform variable information. |
Next steps
- Connections — health, credentials and settings after you connect
- Query languages — syntax, parameters and time ranges
- Chatting with Scout — ask questions without writing a query
- All integrations — the rest of the catalog