steampipe plugin install aiven

Aiven + Steampipe

Aiven is the company that offers the best data infrastructure platform to the world.

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

List your Aiven accounts:

select
id,
name,
billing_enabled,
tenant_id
from
aiven_account;
+--------------+-------------+-----------------+-----------+
| id | name | billing_enabled | tenant_id |
+--------------+-------------+-----------------+-----------+
| a41fdc9a0625 | Turbot-test | false | aiven |
| a41fd3d3b210 | turbot | false | aiven |
+--------------+-------------+-----------------+-----------+

Documentation

Quick start

Install

Download and install the latest Aiven plugin:

steampipe plugin install aiven

Credentials

ItemDescription
CredentialsAiven requires an API key or email and password for all requests.
PermissionsAPI keys have the same permissions as the user who creates them, and if the user permissions change, the API key permissions also change.
RadiusEach connection represents a single Aiven Installation.
Resolution1. Credentials explicitly set in a steampipe config file (~/.steampipe/config/aiven.spc)
2. Credentials specified in environment variables, e.g., AIVEN_TOKEN.

Configuration

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

Configure your account details in ~/.steampipe/config/aiven.spc:

connection "aiven" {
plugin = "aiven"
# You can connect to Aiven using one of the options below:
# Using API Key authentication
# `api_key` (required) - Create an authentication token in the Aiven Console for use with the Aiven CLI or API.
# To create an authentication token, refer to https://docs.aiven.io/docs/platform/howto/create_authentication_token
# Can also be set with the AIVEN_TOKEN environment variable.
# api_key = "oGAxUvrjAdL3QBhWnaJI67Pc9P0rPDzDfhykzVfBYPlmvVH8WdJMKaeVKzcrl4CnyXpjiaKJCCNT+OkbpxfWdDNqwZPngS"
# Using User authentication (without 2FA)
# email = "test@turbot.com"
# password = "test@123"
# If no credentials are specified, the plugin will use Aiven CLI authentication.
# We recommend using API Key authentication for MFA user.
}

Configuring Aiven Credentials

Authentication Token Credentials

You may specify the API key to authenticate:

  • api_key: Specify the authentication token.
connection "aiven" {
plugin = "aiven"
api_key = "oGAxUvrjAdL3QBhWnaJI67Pc9P0rPDzDfhykzVfBYPlmvVH8WdJMKaeVKzcrl4CnyXpjiaKJCCNT+OkbpxfWdDNqwZPngS"
}

User Credentials

You may specify the email ID and password to authenticate:

  • email: Specify the aiven email.
  • password: Specify the aiven password.
connection "aiven" {
plugin = "aiven"
email = "test@turbot.com"
password = "turbot@123"
}

Credentials from Environment Variables

The Aiven plugin will use the Aiven environment variable to obtain credentials only if other arguments (api_key, email, password) are not specified in the connection:

export AIVEN_TOKEN="oGAxUvrjAdL3QBhWnaJI67Pc9P0rPDzDfhykzVfBYPlmvVH8WdJMKaeVKzcrl4Cny"

Aiven CLI

If no credentials are specified and the environment variables are not set, the plugin will use the active credentials from the Aiven CLI. You can run avn user login to set up these credentials.

connection "aiven" {
plugin = "aiven"
}

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

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_aiven;
CREATE SERVER steampipe_aiven FOREIGN DATA WRAPPER steampipe_postgres_aiven OPTIONS (config '<your_config>');
CREATE SCHEMA aiven;
IMPORT FOREIGN SCHEMA aiven FROM SERVER steampipe_aiven INTO aiven;

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

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

$ sqlite3
sqlite> .load ./steampipe_sqlite_extension_aiven.so
sqlite> select steampipe_configure_aiven('<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)" -- aiven

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

steampipe_export_aiven --config '<your_config>' <table_name>