Linode + Steampipe
Linode is a cloud hosting company that provides virtual private servers and other infrastructure services.
Steampipe is an open-source zero-ETL engine to instantly query cloud APIs using SQL.
List instances in your Linode account:
select label, region, statusfrom linode_instance
+-------------+---------+---------+| label | region | status |+-------------+---------+---------+| my-instance | us-east | running |+-------------+---------+---------+
Documentation
Get started
Install
Download and install the latest Linode plugin:
steampipe plugin install linode
Credentials
No credentials are required.
Configuration
Installing the latest linode plugin will create a config file (~/.steampipe/config/linode.spc
) with a single connection named linode
:
connection "linode" { plugin = "linode" token = "5a76843869c183a4ea901c79102bfa1f667f39a2ea0ba857c9a35a9885d91fbd"}
token
- API token from Linode.
Multi-Account Connections
You may create multiple linode connections:
connection "linode_dev" { plugin = "linode" token = "5a76843869c183a4ea901c79102bfa1f667f39a2ea0ba857c9a35a9965d91fbd"}
connection "linode_qa" { plugin = "linode" token = "5a76843869c183a4ty001c79102bfa1f667f39a2ea0ba857c9a35a9965d91fbd"}
connection "linode_prod" { plugin = "linode" token = "5a76843869c183a4ea901c79102bfa1f667f39a2ea0ba857c9a35a7765d91fbd"}
Each connection is implemented as a distinct Postgres schema. As such, you can use qualified table names to query a specific connection:
select *from linode_qa.linode_user
You can create multi-account connections by using an aggregator connection. Aggregators allow you to query data from multiple connections for a plugin as if they are a single connection.
connection "linode_all" { plugin = "linode" type = "aggregator" connections = ["linode_dev", "linode_qa", "linode_prod"]}
Querying tables from this connection will return results from the linode_dev
, linode_qa
, and linode_prod
connections:
select *from linode_all.linode_user
Alternatively, you can use an unqualified name and it will be resolved according to the Search Path. It's a good idea to name your aggregator first alphabetically so that it is the first connection in the search path (i.e. linode_all
comes before linode_dev
):
select *from linode_user
Steampipe supports the *
wildcard in the connection names. For example, to aggregate all the linodeuser plugin connections whose names begin with `linode`:
connection "linode_all" { type = "aggregator" plugin = "linode_user" connections = ["linode_*"]}
Postgres FDW
This plugin is available as a native Postgres FDW. Unlike Steampipe CLI, which ships with an embedded Postgres server instance, the Postgres FDW can be installed in any supported Postgres database version.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_postgres_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/postgres.sh)" -- linode
The installer will prompt you for the plugin name and version, download and install the appropriate files for your OS, system architecture, and Postgres version.
To configure the Postgres FDW, you will create an extension, foreign server, and schema and import the foreign schema.
CREATE EXTENSION IF NOT EXISTS steampipe_postgres_linode;CREATE SERVER steampipe_linode FOREIGN DATA WRAPPER steampipe_postgres_linode OPTIONS (config '<your_config>');CREATE SCHEMA linode;IMPORT FOREIGN SCHEMA linode FROM SERVER steampipe_linode INTO linode;
SQLite Extension
This plugin is available as a SQLite Extension, making the tables available as SQLite virtual tables.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_sqlite_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/sqlite.sh)" -- linode
The installer will prompt you for the plugin name, version, and destination directory. It will then determine the OS and system architecture, and it will download and install the appropriate package.
To configure the SQLite extension, load the extension module and then run the steampipe_configure_linode
function to configure it with plugin-specific options.
$ sqlite3sqlite> .load ./steampipe_sqlite_extension_linode.sosqlite> select steampipe_configure_linode('<your_config>');
Export
This plugin is available as a standalone Export 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)" -- linode
You can pass the configuration to the command with the --config
argument:
steampipe_export_linode --config '<your_config>' <table_name>