turbot/terraform

GitHub
steampipe plugin install terraformsteampipe plugin install terraform

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,
path
from
terraform_data_source;

List AWS EC2 AMIs

select
name,
type,
arguments,
path
from
terraform_data_source
where
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' as
values
,
path
from
filters;

.inspect terraform_data_source

Terraform data source information.

NameTypeDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
argumentsjsonbData source arguments.
countbigintThe integer value for the count meta-argument if it's set as a number in a literal expression.
count_srcjsonbThe count meta-argument accepts a whole number, and creates that many instances of the resource or module.
depends_onjsonbUse the depends_on meta-argument to handle hidden data source or module dependencies that Terraform can't automatically infer.
end_linebigintEnding line number.
for_eachjsonbThe for_each meta-argument accepts a map or a set of strings, and creates an instance for each item in that map or set.
nametextData source name.
pathtextPath to the file.
providertextThe 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.
sourcetextThe block source code.
start_linebigintStarting line number.
typetextData source type.