turbot/digitalocean

steampipe plugin install digitaloceansteampipe plugin install digitalocean

Table: digitalocean_database

DigitalOcean's managed database service simplifies the creation and management of highly available database clusters. Currently, it offers support for PostgreSQL, Redis, and MySQL.

Examples

List all databases

select
*
from
digitalocean_database;

Get database by ID

select
*
from
digitalocean_database
where
id = 'fad76135-48bb-49c8-a274-a9db584e1dc3';

All database users by instance

select
db.name as db_name,
u ->> 'name' as user_name,
u ->> 'role' as user_role
from
digitalocean_database as db,
jsonb_array_elements(users) as u

Databases not using SSL

select
name,
connection_ssl
from
digitalocean_database
where
not connection_ssl
or not private_connection_ssl;

Get database connection

WARNING: DigitalOcean returns the database password as metadata. Use with care!

select
name,
connection_uri,
private_connection_uri
from
digitalocean_database;

Databases by engine version

select
engine,
version,
count(id)
from
digitalocean_database
group by
engine,
version
order by
count desc;

.inspect digitalocean_database

DigitalOcean's managed database service simplifies the creation and management of highly available database clusters. Currently, it offers support for PostgreSQL, Redis, and MySQL.

NameTypeDescription
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
connection_databasetextThe name of the default database.
connection_hosttextA public FQDN pointing to the database cluster's current primary node.
connection_passwordtextThe randomly generated password for the default user.
connection_portbigintThe port on which the database cluster is listening.
connection_sslbooleanA boolean value indicating if the connection should be made over SSL.
connection_uritextA connection string in the format accepted by the psql command. This is provided as a convenience and should be able to be constructed by the other attributes.
connection_usertextThe default user for the database.
created_attimestamp without time zoneTime when the database was created.
db_namesjsonbAn array of strings containing the names of databases created in the database cluster.
enginetextA slug representing the database engine used for the cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL, and "redis" for Redis.
idtextA unique ID that can be used to identify and reference a database cluster.
maintenance_window_daytextThe day of the week on which to apply maintenance updates (e.g. "tuesday").
maintenance_window_descriptionjsonbA list of strings, each containing information about a pending maintenance update.
maintenance_window_hourtextThe hour in UTC at which maintenance updates will be applied in 24 hour format (e.g. "16:00:00").
maintenance_window_pendingbooleanA boolean value indicating whether any maintenance is scheduled to be performed in the next window.
nametextA unique, human-readable name referring to a database cluster.
num_nodesbigintThe number of nodes in the database cluster.
private_connection_databasetextThe name of the default database.
private_connection_hosttextThe private FQDN pointing to the database cluster's current primary node.
private_connection_passwordtextThe randomly generated password for the default user.
private_connection_portbigintThe port on which the database cluster is listening.
private_connection_sslbooleanA boolean value indicating if the connection should be made over SSL.
private_connection_uritextA connection string in the format accepted by the psql command. This is provided as a convenience and should be able to be constructed by the other attributes.
private_connection_usertextThe default user for the database.
private_network_uuidtextA string specifying the UUID of the VPC to which the database cluster is assigned.
region_slugtextThe unique slug identifier for the region the database is deployed in.
size_slugtextThe slug identifier representing the size of the nodes in the database cluster.
statustextA string representing the current status of the database cluster. Possible values include creating, online, resizing, and migrating.
tagsjsonbA map of tags for the resource.
tags_srcjsonbAn array of tags that have been applied to the database cluster.
titletextTitle of the resource.
urntextThe uniform resource name (URN) for the database.
usersjsonbAn array containing objects describing the database's users.
versiontextA string representing the version of the database engine in use for the cluster.