steampipe plugin install fly

Fly.io + Steampipe

Fly.io provides a global application distribution platform where you can run your code in Firecracker microVMs worldwide.

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

List all apps deployed in your organization:

select
name,
app_url,
hostname,
status
from
fly_app;
+---------------------------+-----------------------------+-----------------------------------+-----------+
| name | app_url | hostname | status |
+---------------------------+-----------------------------+-----------------------------------+-----------+
| silent-meadow-6123 | https://2a09:8280:1::1:c64a | silent-meadow-6123.fly.dev | running |
| fly-builder-icy-tree-3230 | <null> | fly-builder-icy-tree-3230.fly.dev | suspended |
+---------------------------+-----------------------------+-----------------------------------+-----------+

Documentation

Get started

Install

Download and install the latest Fly plugin:

steampipe plugin install fly

Credentials

ItemDescription
CredentialsFly requires an API token for all requests.
PermissionsAPI tokens have the same permissions as the user who creates them, and if the user permissions change, the API token permissions also change.
RadiusEach connection represents a single Fly Installation.
Resolution1. Credentials explicitly set in a steampipe config file (~/.steampipe/config/fly.spc)
2. Credentials specified in environment variable, e.g., FLY_API_TOKEN.

Configuration

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

connection "fly" {
plugin = "fly"
# Fly.io API token.
# To generate the token please visit https://fly.io/docs/flyctl/auth-token/
# This can also be set via the `FLY_API_TOKEN` environment variable.
# api_token = "97GtVsdAPwowRToaWDtgZtILdXI_agszONwajQslZ1o"
}

Credentials from Environment Variables

The Fly plugin will use the standard Fly environment variables to obtain credentials only if other argument (api_token) is not specified in the connection:

export FLY_API_TOKEN=97GtVsdAPwowRToaWDtgZtILdXI_agszONwajQslZ1o

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

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_fly;
CREATE SERVER steampipe_fly FOREIGN DATA WRAPPER steampipe_postgres_fly OPTIONS (config '<your_config>');
CREATE SCHEMA fly;
IMPORT FOREIGN SCHEMA fly FROM SERVER steampipe_fly INTO fly;

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

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

$ sqlite3
sqlite> .load ./steampipe_sqlite_extension_fly.so
sqlite> select steampipe_configure_fly('<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)" -- fly

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

steampipe_export_fly --config '<your_config>' <table_name>