Connect to Turbot Pipes from VS Code
VS Code is a source code editor with a rich catalog of extensions, some of which can connect to databases.
Steampipe provides a single interface to all your cloud, code, logs and more. Because it's built on Postgres, Steampipe provides an endpoint that any Postgres-compatible client -- including VS Code database extensions -- can connect to.
The Connect tab for your workspace provides the details you need to connect VS Code to Turbot Pipes.
Once Turbot Pipes is successfully connected, you can explore the tables provided by the Steampipe plugins, run queries and build reports.
Similarly, you can also connect VS Code to
Steampipe CLI. To do that, run
steampipe service start --show-password and use the displayed connection
Steampipe service is running:Database:Host(s): localhost, 127.0.0.1, 192.168.29.204Port: 9193Database: steampipeUser: steampipePassword: 99**_****_**8cConnection string: postgres://steampipe:99**_****_**8c@localhost:9193/steampipe
There are a number of VS Code extensions that connect to and query databases. For this example we'll use Chris Koklman's extension.
To create a connection via the command palette, choose
PostgreSQL: Add Connection and add the connection details.
Once you're connected to Turbot Pipes, the PostgreSQL Explorer can access the
tables available in your workspace. Here we'll use the AWS connection and query
aws_ebs_volume table. VS Code displays the table's schema and previews its
data. You can export the data to JSON, XML, or CSV.
Run your first custom query
Use the query editor to write and run custom queries. This query fetches the list of enabled AWS regions.
selectname,opt_in_statusfromaws_regionwhereopt_in_status = 'not-opted-in';