turbot/digitalocean
steampipe plugin install digitalocean

Table: digitalocean_droplet - Query DigitalOcean Droplets using SQL

A DigitalOcean Droplet is a scalable compute platform with add-on storage, security, and monitoring capabilities. Choose the OS or application that best suits your needs and deploy Droplets on the datacenter region closest to your app or users. Droplets are virtual machines available in multiple configurations of CPU, memory, and SSD.

Table Usage Guide

The digitalocean_droplet table provides insights into Droplets within DigitalOcean. As a DevOps engineer, explore Droplet-specific details through this table, including region, size, status, and associated metadata. Utilize it to uncover information about Droplets, such as their current status, the resources they're using, and their location.

Examples

List all droplets

Explore all the active droplets in your DigitalOcean account to gain insights into their status and configuration. This can help you manage resources more efficiently and identify any potential issues.

select
*
from
digitalocean_droplet;
select
*
from
digitalocean_droplet;

Get a droplet by ID

Determine the specifics of a particular DigitalOcean droplet based on its unique identifier. This is useful for gaining insights into the droplet's configuration and status.

select
*
from
digitalocean_droplet
where
id = 227211874;
select
*
from
digitalocean_droplet
where
id = 227211874;

Droplets by region_slug

Analyze the distribution of digital ocean droplets across various regions, providing insights into memory allocation and usage patterns in each region. This allows for better resource management and planning for future deployments.

select
region_slug,
count(id),
sum(memory) as total_memory
from
digitalocean_droplet
group by
region_slug
order by
region_slug;
select
region_slug,
count(id),
sum(memory) as total_memory
from
digitalocean_droplet
group by
region_slug
order by
region_slug;

Droplets that do not have backups enabled

Discover the segments that have not enabled backups on their digital ocean droplets. This is crucial for assessing the potential risk of data loss and implementing necessary safeguards.

select
name,
region_slug,
features
from
digitalocean_droplet
where
not features ? 'backups';
select
name,
region_slug,
features
from
digitalocean_droplet
where
json_extract(features, '$.backups') is null;

Droplet network addresses

Explore the network configurations of your DigitalOcean resources to gain insights into their geographical distribution and connectivity details. This helps in better understanding of your resource allocation and planning for future scaling or migration activities.

select
name,
region_slug,
private_ipv4,
public_ipv4,
public_ipv6
from
digitalocean_droplet;
select
name,
region_slug,
private_ipv4,
public_ipv4,
public_ipv6
from
digitalocean_droplet;

Largest droplets

Discover the ten largest droplets in terms of memory within your DigitalOcean environment. This can help you manage resources more effectively and identify potential areas for optimization.

select
name,
region_slug,
memory
from
digitalocean_droplet
order by
memory desc
limit
10;
select
name,
region_slug,
memory
from
digitalocean_droplet
order by
memory desc
limit
10;

Oldest droplets

Explore which DigitalOcean droplets were created first to better manage and prioritize system resources or updates. This can be useful in identifying older instances that may require upgrades or maintenance.

select
name,
region_slug,
created_at
from
digitalocean_droplet
order by
created_at
limit
10;
select
name,
region_slug,
created_at
from
digitalocean_droplet
order by
created_at
limit
10;

Droplets with tag "production"

Determine the areas in which your digital ocean droplets are tagged as 'production'. This can be useful to quickly identify and manage all production-related resources in your infrastructure.

select
name,
region_slug,
tags
from
digitalocean_droplet
where
tags ? 'production';
select
name,
region_slug,
tags
from
digitalocean_droplet
where
json_extract(tags, '$.production') is not null;

Schema for digitalocean_droplet

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
backup_idsjsonbAn array of backup IDs of any backups that have been taken of the Droplet instance.
created_attimestamp with time zoneTime when the Droplet was created.
diskbigintThe size of the Droplet's disk in gigabytes.
featuresjsonbAn array of features enabled on this Droplet.
idbigint=A unique identifier for each Droplet instance.
imagejsonbInformation about the base image used to create the Droplet instance.
kerneljsonbThe current kernel. This will initially be set to the kernel of the base image when the Droplet is created.
lockedbooleanA boolean value indicating whether the Droplet has been locked, preventing actions by users.
memorybigintMemory of the Droplet in megabytes.
nametextThe human-readable name set for the Droplet instance.
networksjsonbThe details of the network that are configured for the Droplet instance. This is an object that contains keys for IPv4 and IPv6. The value of each of these is an array that contains objects describing an individual IP resource allocated to the Droplet. These will define attributes like the IP address, netmask, and gateway of the specific network depending on the type of network it is.
next_backup_window_endtextEnd time of the window during which the backup will start.
next_backup_window_starttextStart time of the window during which the backup will start.
private_ipv4inetPrivate IPv4 address of the Droplet.
public_ipv4inetPublic IPv4 address of the Droplet.
public_ipv6inetPublic IPv6 address of the Droplet.
regionjsonbInformation about region that the Droplet instance is deployed in.
region_slugtextThe unique slug identifier for the region the Droplet is deployed in.
sizejsonbInformation about the size of the Droplet. Note: Due to resize operations, the disk column is more accurate than the disk field in this size data.
size_slugtextThe unique slug identifier for the size of this Droplet.
snapshot_idsjsonbAn array of snapshot IDs of any snapshots created from the Droplet instance.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
statustextA status string indicating the state of the Droplet instance. This may be "new", "active", "off", or "archive".
tagsjsonbA map of tags for the resource.
tags_srcjsonbAn array of tags the Droplet has been tagged with.
titletextTitle of the resource.
urntextThe uniform resource name (URN) for the Droplet.
vcpusbigintThe number of virtual CPUs.
volume_idsjsonbA flat array including the unique identifier for each Block Storage volume attached to the Droplet.
vpc_uuidtextA string specifying the UUID of the VPC to which the Droplet is assigned.