Table: terraform_data_source
Data sources allow Terraform use information defined outside of Terraform, defined by another separate Terraform configuration, or modified by functions.
Examples
Basic info
select name, type, arguments, pathfrom terraform_data_source;
List AWS EC2 AMIs
select name, type, arguments, pathfrom terraform_data_sourcewhere type = 'aws_ami'
Get filters for each AWS EC2 AMI
with filters as ( select name, type, jsonb_array_elements(arguments -> 'filter') as filter, path from terraform_data_source where type = 'aws_ami')select name, type, filter -> 'name' as name, filter -> 'values' asvalues, pathfrom filters;
.inspect terraform_data_source
Terraform data source information.
Name | Type | Description |
---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. |
arguments | jsonb | Data source arguments. |
count | bigint | The integer value for the count meta-argument if it's set as a number in a literal expression. |
count_src | jsonb | The count meta-argument accepts a whole number, and creates that many instances of the resource or module. |
depends_on | jsonb | Use the depends_on meta-argument to handle hidden data source or module dependencies that Terraform can't automatically infer. |
end_line | bigint | Ending line number. |
for_each | jsonb | The for_each meta-argument accepts a map or a set of strings, and creates an instance for each item in that map or set. |
name | text | Data source name. |
path | text | Path to the file. |
provider | text | The provider meta-argument specifies which provider configuration to use for a data source, overriding Terraform's default behavior of selecting one based on the data source type name. |
source | text | The block source code. |
start_line | bigint | Starting line number. |
type | text | Data source type. |