steampipe plugin install workos

WorkOS + Steampipe

WorkOS is a modern API platform that empowers any developer to quickly build and ship enterprise features.

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

List your WorkOS organizations:

select
id,
name,
allow_profiles_outside_organization,
created_at
from
workos_organization;
+--------------------------------+-------------+-------------------------------------+---------------------------+
| id | name | allow_profiles_outside_organization | created_at |
+--------------------------------+-------------+-------------------------------------+---------------------------+
| org_01GX5EDRXZV7GTF3SQHXKHBGFE | turbot | true | 2023-04-04T11:44:18+05:30 |
| org_01GX5SQ6CBFKP7X1A804PH4FT8 | turbot-dev | true | 2023-04-04T15:01:41+05:30 |
+--------------------------------+-------------+-------------------------------------+---------------------------+

Documentation

Quick start

Install

Download and install the latest WorkOS plugin:

steampipe plugin install workos

Credentials

ItemDescription
CredentialsWorkOS requires an API Key for all requests.
PermissionsAPI keys have the same permission as the user who creates them, and if the user permissions change, the API key permissions also change.
RadiusEach connection represents a single WorkOS Installation.
Resolution1. Credentials explicitly set in a steampipe config file (~/.steampipe/config/workos.spc)
2. Credentials specified in environment variables, e.g., WORKOS_API_KEY.

Configuration

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

connection "workos" {
plugin = "workos"
# `api_key` - API key for your WorkOS account. (Required)
# For more information on the API Key, please see https://workos.com/docs/reference/api-keys.
# Can also be set with the WORKOS_API_KEY environment variable.
# api_key = "sk_test_a2V5XzAxR1g1QjNDRTFCU1NYSEhZMktINjVWTUFSLHBUSm1pWGpVMnV6dDNK"
}

Alternatively, you can also use the standard WorkOS environment variables to obtain credentials only if other argument (api_key) is not specified in the connection:

export WORKOS_API_KEY=sk_test_a2V5XzAxR1g1QjNDRTFCU1NYSEhZMktINjVWTUFSLHBUSm1pWGpVMnV6dDNK

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

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_workos;
CREATE SERVER steampipe_workos FOREIGN DATA WRAPPER steampipe_postgres_workos OPTIONS (config '<your_config>');
CREATE SCHEMA workos;
IMPORT FOREIGN SCHEMA workos FROM SERVER steampipe_workos INTO workos;

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

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

$ sqlite3
sqlite> .load ./steampipe_sqlite_extension_workos.so
sqlite> select steampipe_configure_workos('<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)" -- workos

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

steampipe_export_workos --config '<your_config>' <table_name>