Table: tfe_variable - Query Terraform Enterprise Variables using SQL
A Terraform Enterprise Variable is a key-value pair that defines the infrastructure and configurations. Variables in Terraform Enterprise provide a flexible and dynamic way of managing and organizing resources. They are used to customize aspects of the execution plan and to store sensitive information securely.
Table Usage Guide
The tfe_variable
table provides insights into Variables within Terraform Enterprise. As a DevOps engineer, explore variable-specific details through this table, including key-value pairs, category, and associated workspace. Utilize it to manage and organize your resources, customize your execution plan, and securely store sensitive information.
Important Notes
- You must specify the
workspace_id
in thewhere
clause to query this table.
Examples
Basic info
Discover the segments that contain sensitive information within a specific workspace. This is beneficial in maintaining data security and ensuring only authorized personnel have access to sensitive data.
select id, key, value, category, sensitivefrom tfe_variablewhere workspace_id = 'ws-1SWwYqrgF3Aeazmn';
select id, key, value, category, sensitivefrom tfe_variablewhere workspace_id = 'ws-1SWwYqrgF3Aeazmn';
List environment variables
Explore which environment variables are associated with a specific workspace, allowing you to understand and manage the settings and configurations for that workspace.
select id, key, value, categoryfrom tfe_variablewhere workspace_id = 'ws-1SWwYqrgF3Aeazmn' and category = 'env';
select id, key, value, categoryfrom tfe_variablewhere workspace_id = 'ws-1SWwYqrgF3Aeazmn' and category = 'env';
List sensitive variables
Analyze the settings to understand which variables within a specific workspace are sensitive. This can aid in maintaining security and confidentiality within your system.
select id, key, value, sensitivefrom tfe_variablewhere workspace_id = 'ws-1SWwYqrgF3Aeazmn' and sensitive;
select id, key, value, sensitivefrom tfe_variablewhere workspace_id = 'ws-1SWwYqrgF3Aeazmn' and sensitive;
Schema for tfe_variable
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
category | text | Whether this is a Terraform or environment variable. Valid values are terraform or env. | |
description | text | Description of the variable. | |
id | text | = | ID of the variable. |
key | text | Name of the variable. | |
sensitive | boolean | Whether the value is sensitive. If true then the variable is written once and not visible thereafter. Defaults to false. | |
value | text | Value of the variable. | |
workspace | jsonb | Workspace information. | |
workspace_id | text | = | ID of the workspace. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- tfe
You can pass the configuration to the command with the --config
argument:
steampipe_export_tfe --config '<your_config>' tfe_variable