LaunchDarkly + Steampipe
LaunchDarkly is a feature management platform that enables software teams to build better software faster by safely serving and controlling software features in production.
Steampipe is an open-source zero-ETL engine to instantly query cloud APIs using SQL.
List feature flags in your LaunchDarkly account:
select name, key, version, creation_date, kindfrom launchdarkly_feature_flag;
+----------------------+----------------------+---------+---------------------------+--------------+| name | key | version | creation_date | kind |+----------------------+----------------------+---------+---------------------------+--------------+| dark-light-mode-node | dark-light-mode-node | 1 | 2023-04-24T10:28:26+05:30 | boolean || first-flag-test | first-flag-test | 1 | 2023-04-25T15:36:33+05:30 | multivariate || alphabet-flag | num-flag | 1 | 2023-04-24T11:20:39+05:30 | multivariate || hello-world | go-world | 2 | 2023-04-25T16:46:23+05:30 | boolean |+----------------------+----------------------+---------+---------------------------+--------------+
Documentation
Quick start
Install
Download and install the latest LaunchDarkly plugin:
steampipe plugin install launchdarkly
Credentials
Item | Description |
---|---|
Credentials | LaunchDarkly requires an Access token for all requests. |
Permissions | Access tokens have the same permissions as the user who creates them, and if the user permissions change, the Access token permissions also change. |
Radius | Each connection represents a single LaunchDarkly Installation. |
Resolution | 1. Credentials explicitly set in a steampipe config file (~/.steampipe/config/launchdarkly.spc )2. Credentials specified in environment variables, e.g., LAUNCHDARKLY_ACCESS_TOKEN . |
Configuration
Installing the latest launchdarkly plugin will create a config file (~/.steampipe/config/launchdarkly.spc
) with a single connection named launchdarkly
:
Configure your account details in ~/.steampipe/config/launchdarkly.spc
:
connection "launchdarkly" { plugin = "launchdarkly"
# `access_token`: LaunchDarkly Access Token. (Required) # Generate your Access Token per https://docs.launchdarkly.com/home/account-security/api-access-tokens#creating-api-access-tokens # This can also be set via the `LAUNCHDARKLY_ACCESS_TOKEN` environment variable. # access_token = "api-dd8ce121-cd11-401c-be02-322b7362111d"}
Alternatively, you can also use the standard LaunchDarkly environment variables to obtain credentials only if other arguments (access_token
) are not specified in the connection:
export LAUNCHDARKLY_ACCESS_TOKEN=api-dd8ce121-cd11-401c-be02-322b7362111d
)
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)" -- launchdarkly
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_launchdarkly;CREATE SERVER steampipe_launchdarkly FOREIGN DATA WRAPPER steampipe_postgres_launchdarkly OPTIONS (config '<your_config>');CREATE SCHEMA launchdarkly;IMPORT FOREIGN SCHEMA launchdarkly FROM SERVER steampipe_launchdarkly INTO launchdarkly;
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)" -- launchdarkly
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_launchdarkly
function to configure it with plugin-specific options.
$ sqlite3sqlite> .load ./steampipe_sqlite_extension_launchdarkly.sosqlite> select steampipe_configure_launchdarkly('<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)" -- launchdarkly
You can pass the configuration to the command with the --config
argument:
steampipe_export_launchdarkly --config '<your_config>' <table_name>