Table: terraform_output - Query Terraform Outputs using SQL
Terraform Outputs serve as a means to extract data from a Terraform state. These outputs can be simple strings or complex data structures such as lists or maps. They provide a way to share information between modules, access computed values, and manage resource configurations.
Output values are like the return values of a Terraform module, and have several uses:
- A child module can use outputs to expose a subset of its resource attributes to a parent module.
- A root module can use outputs to print certain values in the CLI output after running terraform apply.
- When using remote state, root module outputs can be accessed by other configurations via a terraform_remote_state data source.
Table Usage Guide
The terraform_output
table provides insights into the outputs from Terraform state files. As a DevOps engineer, you can explore output-specific details through this table, including the values, types, and associated state files. Utilize it to manage and monitor your Terraform infrastructure, ensuring configurations are as expected and aiding in troubleshooting.
Examples
Basic info
Discover the segments that contain specific values within your Terraform outputs. This can be particularly useful in understanding the distribution and organization of your data.Explore the key details of your Terraform configuration outputs. 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, value, pathfrom terraform_output;
select name, description, value, pathfrom terraform_output;
List sensitive outputs
Discover the segments that contain sensitive information within your Terraform outputs. This can help in identifying potential security risks and take necessary precautions to protect your data.Explore which outputs in your Terraform configuration are marked as sensitive. This is useful for maintaining data security and confidentiality.
select name, description, pathfrom terraform_outputwhere sensitive;
select name, description, pathfrom terraform_outputwhere sensitive = 1;
List outputs referring to AWS S3 bucket ARN attributes
Explore which Terraform outputs reference AWS S3 bucket ARN attributes. This can be useful for identifying dependencies or potential configuration issues.Analyze the settings to understand the connections between your Terraform outputs and AWS S3 bucket ARN attributes. This is useful to identify potential dependencies or configurations that may impact your S3 bucket usage.
select name, description, value, pathfrom terraform_outputwhere value :: text like '%aws_s3_bucket.%.arn%';
select name, description, value, pathfrom terraform_outputwhere value like '%aws_s3_bucket.%.arn%';
Schema for terraform_output
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
depends_on | jsonb | Use the depends_on meta-argument to handle hidden output or module dependencies that Terraform can't automatically infer. | |
description | text | Because the output 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 | Output name. | |
path | text | = | Path to the file. |
sensitive | boolean | An output 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. | |
value | jsonb | The value argument takes an expression whose result is to be returned to the user. |
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_output