Scalingo + Steampipe
Scalingo provides on-demand cloud computing platforms and APIs to authenticated customers on a metered pay-as-you-go basis.
Steampipe is an open source CLI to instantly query cloud APIs using SQL.
For example:
select name, region, urlfrom scalingo_app
+--------------------+----------------+------------------------------------------------------+| name | region | url |+--------------------+----------------+------------------------------------------------------+| caresteouvert-map | osc-fr1 | https://caresteouvert.fr || caresteouvert-api | osc-secnum-fr1 | https://caresteouvert-api.osc-secnum-fr1.scalingo.io |+--------------------+----------------+------------------------------------------------------+
Documentation
Get started
Install
Download and install the latest Scalingo plugin:
steampipe plugin install francois2metz/scalingo
Credentials
Item | Description |
---|---|
Credentials | Scalingo requires a token. |
Permissions | Tokens have the same permissions as the user who creates them. |
Radius | Each connection represents a single Scalingo account. |
Resolution | 1. Credentials explicitly set in a steampipe config file (~/.steampipe/config/scalingo.spc )2. Credentials specified in environment variables, e.g., SCALINGO_TOKEN . |
Configuration
Installing the latest scalingo plugin will create a config file (~/.steampipe/config/scalingo.spc
) with a single connection named scalingo
:
connection "scalingo" { plugin = "francois2metz/scalingo"
# API token for your scalingo instance (required). # Get it on: https://dashboard.scalingo.com/account/tokens # This can also be set via the `SCALINGO_TOKEN` environment variable. # token = "tk-us-0000-0000-000000000-000000000000000"
# Regions # By default the scalingo plugin will only use the osc-fr1 region # regions = ["osc-fr1", "osc-secnum-fr1"]}
Credentials from Environment Variables
The Scalingo plugin will use the following environment variables to obtain credentials only if other argument (token
) is not specified in the connection:
export SCALINGO_TOKEN=tk-us-00000-0000-000
Get Involved
Multi-Account Connections
You may create multiple scalingo connections:
connection "scalingo_osc" { plugin = "francois2metz/scalingo" regions = ["osc-fr1"] token = "tk-us-00000-0000-000"}
connection "scalingo_secnum" { plugin = "francois2metz/scalingo" regions = ["osc-secnum-fr1"] token = "tk-us-00000-0000-000"}
Each connection is implemented as a distinct Postgres schema. As such, you can use qualified table names to query a specific connection:
select *from scalingo_osc.scalingo_app
You can 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 "scalingo_all" { plugin = "francois2metz/scalingo" type = "aggregator" connections = ["scalingo_osc", "scalingo_secnum"]}
Querying tables from this connection will return results from the scalingo_osc
, and scalingo_secnum
connections:
select *from scalingo_all.scalingo_app
Steampipe supports the *
wildcard in the connection names. For example, to aggregate all the Scalingo plugin connections whose names begin with scalingo_
:
connection "scalingo_all" { type = "aggregator" plugin = "francois2metz/scalingo" connections = ["scalingo_*"]}