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, pathfrom terraform_variable;
select name, description, type, default_value, pathfrom 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, typefrom terraform_variablewhere validation is not null;
select name, validation, typefrom terraform_variablewhere 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, sensitivefrom terraform_variablewhere sensitive;
select name, description, sensitivefrom terraform_variablewhere sensitive = 1;
Schema for terraform_variable
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
default_value | jsonb | The default value for the variable. | |
description | text | Because 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_line | bigint | Ending line number. | |
name | text | The variable name. | |
path | text | = | Path to the file. |
sensitive | boolean | An variable can be marked as containing sensitive material using the optional sensitive argument. | |
source | text | The block source code. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
start_line | bigint | Starting line number. | |
type | text | The variable type. | |
validation | text | The 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