steampipe plugin install tfe

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 the where 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,
sensitive
from
tfe_variable
where
workspace_id = 'ws-1SWwYqrgF3Aeazmn';
select
id,
key,
value,
category,
sensitive
from
tfe_variable
where
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,
category
from
tfe_variable
where
workspace_id = 'ws-1SWwYqrgF3Aeazmn'
and category = 'env';
select
id,
key,
value,
category
from
tfe_variable
where
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,
sensitive
from
tfe_variable
where
workspace_id = 'ws-1SWwYqrgF3Aeazmn'
and sensitive;
select
id,
key,
value,
sensitive
from
tfe_variable
where
workspace_id = 'ws-1SWwYqrgF3Aeazmn'
and sensitive;

Schema for tfe_variable

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
categorytextWhether this is a Terraform or environment variable. Valid values are terraform or env.
descriptiontextDescription of the variable.
idtext=ID of the variable.
keytextName of the variable.
organization_nametext=, !=, ~~, ~~*, !~~, !~~*Name of the organization containing the organization member.
sensitivebooleanWhether the value is sensitive. If true then the variable is written once and not visible thereafter. Defaults to false.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
valuetextValue of the variable.
workspacejsonbWorkspace information.
workspace_idtext=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