turbot/terraform
steampipe plugin install terraform

Table: terraform_variable - Query Terraform Variables using SQL

Terraform Variables define the parameters that can be customized during the execution of a Terraform configuration. They allow users to provide input values for Terraform configurations, making them reusable and more flexible. Variables can have default values, descriptions, types, and validations to ensure proper usage.

Table Usage Guide

The terraform_variable table provides insights into the variables defined in your Terraform configurations. As a DevOps engineer, you can explore variable-specific details through this table, including their names, types, default values, descriptions, and validation rules. Utilize it to manage and monitor your Terraform infrastructure, ensuring configurations are as expected and aiding in troubleshooting.

Examples

Basic Info

Explore the key details of your Terraform configuration variables. This can help you understand the values and paths associated with different elements of your configuration, and can be useful in troubleshooting or optimizing your setup.

select
name,
description,
type,
default_value,
path
from
terraform_variable;
select
name,
description,
type,
default_value,
path
from
terraform_variable;

List Variables with Validation Rules

Identify the variables that have validation rules applied. This is useful for ensuring that the constraints on variable values are properly understood and managed.

select
name,
validation,
type
from
terraform_variable
where
validation is not null;
select
name,
validation,
type
from
terraform_variable
where
validation is not null;

Sensitive Variables

Discover which variables in your Terraform configuration are marked as sensitive. This is useful for maintaining data security and confidentiality.

select
name,
description,
sensitive
from
terraform_variable
where
sensitive;
select
name,
description,
sensitive
from
terraform_variable
where
sensitive = 1;

Schema for terraform_variable

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
default_valuejsonbThe default value for the variable.
descriptiontextBecause the variable values of a module are part of its user interface, you can briefly describe the purpose of each value using the optional description argument.
end_linebigintEnding line number.
nametextThe variable name.
pathtext=Path to the file.
sensitivebooleanAn variable can be marked as containing sensitive material using the optional sensitive argument.
sourcetextThe block source code.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
start_linebigintStarting line number.
typetextThe variable type.
validationtextThe validation applied on the variable.

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)" -- terraform

You can pass the configuration to the command with the --config argument:

steampipe_export_terraform --config '<your_config>' terraform_variable