turbot/digitalocean
steampipe plugin install digitalocean

DigitalOcean + Steampipe

Query your DigitalOcean infrastructure including droplets, databases, networks, and more.

DigitalOcean provides scalable and on-demand cloud infrastructure solutions for hosting or storage needs.

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

For example:

select
slug,
name,
available
from
digitalocean_region
+------+-------------+-----------+
| slug | name | available |
+------+-------------+-----------+
| nyc1 | New York 1 | true |
| nyc3 | New York 3 | true |
| ams2 | Amsterdam 2 | false |
| sgp1 | Singapore 1 | true |
| nyc2 | New York 2 | false |
+------+-------------+-----------+

Documentation

Get started

Install

Download and install the latest DigitalOcean plugin:

steampipe plugin install digitalocean

Configuration

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

connection "digitalocean" {
plugin = "digitalocean"
# Personal Access Token for your DigitalOcean account
# Reference: https://www.digitalocean.com/docs/apis-clis/api/create-personal-access-token
# Env variables (in order of precedence): DIGITALOCEAN_TOKEN, DIGITALOCEAN_ACCESS_TOKEN
# token = "YOUR_DIGITALOCEAN_ACCESS_TOKEN"
}

Multi-Account Connections

You may create multiple digitalocean connections:

connection "do_dev" {
plugin = "digitalocean"
token = "1646968370949-df954218b5da5b8614c85cc4541abcde"
}
connection "do_qa" {
plugin = "digitalocean"
token = "1646968370949-df954218b5da5b8614c85cc4541fghij"
}
connection "do_prod" {
plugin = "digitalocean"
token = "1646968370949-df954218b5da5b8614c85cc4541klmno"
}

Each connection is implemented as a distinct Postgres schema. As such, you can use qualified table names to query a specific connection:

select
*
from
do_qa.digitalocean_project

You can create 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 "do_all" {
plugin = "digitalocean"
type = "aggregator"
connections = ["do_dev", "do_qa", "do_prod"]
}

Querying tables from this connection will return results from the do_dev, do_qa, and do_prod connections:

select
*
from
do_all.digitalocean_project

Alternatively, you can use an unqualified name and it will be resolved according to the Search Path. It's a good idea to name your aggregator first alphabetically so that it is the first connection in the search path (i.e. do_all comes before do_dev):

select
*
from
digitalocean_project

Steampipe supports the * wildcard in the connection names. For example, to aggregate all the digitalocean plugin connections whose names begin with do_:

connection "do_all" {
type = "aggregator"
plugin = "digitalocean"
connections = ["do_*"]
}

Get Involved