steampipe plugin install equinix

Equinix + Steampipe

Steampipe is an open-source zero-ETL engine to instantly query cloud APIs using SQL.

Equinix Metal delivers global, interconnected, integrated, and on-demand bare-metal infrastructure as a service. As the name implies, these bare metal servers do not require virtualization or multi-tenancy. The provisioned infrastructure is deployed at Equinix data center locations allowing enabling direct network interconnects to other cloud providers and a global network backbone.

For example:

select
hostname,
state,
tags
from
equinix_metal_device
+-----------------------+--------+---------------+
| hostname | state | tags |
+-----------------------+--------+---------------+
| dc13-c3.medium.x86-01 | active | {"prod":true} |
+-----------------------+--------+---------------+

Documentation

Get started

Install

Download and install the latest Equinix Metal plugin:

steampipe plugin install equinix

Credentials

ItemDescription
CredentialsUse an API Token.
PermissionsRead-only
RadiusEach connection represents a single Equinix Metal account.
Resolution1. token in Steampipe config.
2. PACKET_AUTH_TOKEN environment variable. (A legacy name.)

Configuration

Installing the latest equinix plugin will create a config file (~/.steampipe/config/equinix.spc) with a single connection named equinix:

connection "equinix" {
plugin = "equinix"
token = "XV1JE4QXVHdCYoWT2wbr2NRdPYrZRx3N"
}

Multi-Account Connections

You may create multiple equinix connections:

connection "equinix_dev" {
plugin = "equinix"
token = "XV1KL4QXVHcCYoWT2wbr2NRdRTrZRx3K"
}
connection "equinix_qa" {
plugin = "equinix"
token = "XV1KL4QXVHcCYoWT2wbr2NRdRTrZRx3L"
}
connection "equinix_prod" {
plugin = "equinix"
token = "XV1KL4QXVHcCYoWT2wbr2NRdRTrZRx3M"
}

Each connection is implemented as a distinct Postgres schema. As such, you can use qualified table names to query a specific connection:

select
*
from
equinix_qa.equinix_metal_organization

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 "equinix_all" {
plugin = "equinix"
type = "aggregator"
connections = ["equinix_dev", "equinix_qa", "equinix_prod"]
}

Querying tables from this connection will return results from the equinix_dev, equinix_qa, and equinix_prod connections:

select
*
from
equinix_all.equinix_metal_organization

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. equinix_all comes before equinix_dev):

select
*
from
equinix_metal_organization

Steampipe supports the * wildcard in the connection names. For example, to aggregate all the equinix plugin connections whose names begin with equinix_:

connection "equinix_all" {
type = "aggregator"
plugin = "equinix"
connections = ["equinix_*"]
}

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)" -- equinix

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_equinix;
CREATE SERVER steampipe_equinix FOREIGN DATA WRAPPER steampipe_postgres_equinix OPTIONS (config '<your_config>');
CREATE SCHEMA equinix;
IMPORT FOREIGN SCHEMA equinix FROM SERVER steampipe_equinix INTO equinix;

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)" -- equinix

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_equinix function to configure it with plugin-specific options.

$ sqlite3
sqlite> .load ./steampipe_sqlite_extension_equinix.so
sqlite> select steampipe_configure_equinix('<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)" -- equinix

You can pass the configuration to the command with the --config argument:

steampipe_export_equinix --config '<your_config>' <table_name>