Use SQL to query data from Terraform configuration files.
Quick start
Install the plugin with Steampipe:
steampipe plugin install terraform
Configure your config file to include directories with Terraform configuration files. If no directory is specified, the current working directory will be used.
Run steampipe:
steampipe query
Query all resources in your Terraform files:
select
name,
type,
jsonb_pretty(arguments) as args
from
terraform_resource;
> select name, type, jsonb_pretty(arguments) as args from terraform_resource;
+------------+----------------+--------------------------------------------+
| name | type | args |
+------------+----------------+--------------------------------------------+
| app_server | aws_instance | { |
| | | "ami": "ami-830c94e3", |
| | | "tags": { |
| | | "Name": "ExampleAppServerInstance" |
| | | }, |
| | | "instance_type": "t2.micro" |
| | | } |
| app_volume | aws_ebs_volume | { |
| | | "size": 40, |
| | | "tags": { |
| | | "Name": "HelloWorld" |
| | | }, |
| | | "availability_zone": "us-west-2a" |
| | | } |
| app_bucket | aws_s3_bucket | { |
| | | "acl": "private", |
| | | "tags": { |
| | | "Name": "Test bucket", |
| | | "Environment": "Dev" |
| | | }, |
| | | "bucket": "my-app-bucket" |
| | | } |
+------------+----------------+--------------------------------------------+
Developing
Prerequisites:
Clone:
git clone https://github.com/turbot/steampipe-plugin-terraform.git
cd steampipe-plugin-terraform
Build, which automatically installs the new version to your ~/.steampipe/plugins
directory:
make
Configure the plugin:
cp config/* ~/.steampipe/config
vi ~/.steampipe/config/terraform.spc
Try it!
steampipe query
> .inspect terraform
Further reading:
Contributing
Please see the contribution guidelines and our code of conduct. All contributions are subject to the Apache 2.0 open source license.
help wanted
issues: