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_dropletwhere id = 227211874;
select *from digitalocean_dropletwhere 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_memoryfrom digitalocean_dropletgroup by region_slugorder by region_slug;
select region_slug, count(id), sum(memory) as total_memoryfrom digitalocean_dropletgroup by region_slugorder 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, featuresfrom digitalocean_dropletwhere not features ? 'backups';
select name, region_slug, featuresfrom digitalocean_dropletwhere 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_ipv6from digitalocean_droplet;
select name, region_slug, private_ipv4, public_ipv4, public_ipv6from 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, memoryfrom digitalocean_dropletorder by memory desclimit 10;
select name, region_slug, memoryfrom digitalocean_dropletorder by memory desclimit 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_atfrom digitalocean_dropletorder by created_atlimit 10;
select name, region_slug, created_atfrom digitalocean_dropletorder by created_atlimit 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, tagsfrom digitalocean_dropletwhere tags ? 'production';
select name, region_slug, tagsfrom digitalocean_dropletwhere json_extract(tags, '$.production') is not null;
Query examples
- blockstorage_volumes_for_droplet
- digitalocean_droplet_1_year_count
- digitalocean_droplet_24_hours_count
- digitalocean_droplet_30_90_days_count
- digitalocean_droplet_30_days_count
- digitalocean_droplet_90_365_days_count
- droplet_attached_volumes
- droplet_backup_disabled
- droplet_by_distribution_type
- droplet_by_public_access
- droplet_by_region
- droplet_count
- droplet_creation_month
- droplet_droplets_for_blockstorage_volume
- droplet_droplets_for_database_cluster
- droplet_droplets_for_network_firewall
- droplet_droplets_for_network_vpc
- droplet_firewall_configuration
- droplet_input
- droplet_network_vpc_details
- droplet_overview
- droplet_public_access
- droplet_publicly_accessible
- droplet_storage
- droplet_tags
- droplet_total_size
- droplet_vcpus
- image_images_for_droplet
- kubernetes_cluster_nodes_for_kubernetes_cluster
- network_firewall_attached
- network_firewalls_for_droplet
- network_firewalls_for_network_vpc
- network_floating_ips_for_droplet
- network_load_balancers_for_droplet
- network_vpc_association
- network_vpcs_for_droplet
- network_vpcs_for_network_firewall
- snapshot_snapshots_for_droplet
- source_droplet_droplets_for_snapshot
- target_droplet_droplets_for_snapshot
Schema for digitalocean_droplet
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
backup_ids | jsonb | An array of backup IDs of any backups that have been taken of the Droplet instance. | |
created_at | timestamp with time zone | Time when the Droplet was created. | |
disk | bigint | The size of the Droplet's disk in gigabytes. | |
features | jsonb | An array of features enabled on this Droplet. | |
id | bigint | = | A unique identifier for each Droplet instance. |
image | jsonb | Information about the base image used to create the Droplet instance. | |
kernel | jsonb | The current kernel. This will initially be set to the kernel of the base image when the Droplet is created. | |
locked | boolean | A boolean value indicating whether the Droplet has been locked, preventing actions by users. | |
memory | bigint | Memory of the Droplet in megabytes. | |
name | text | The human-readable name set for the Droplet instance. | |
networks | jsonb | The 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_end | text | End time of the window during which the backup will start. | |
next_backup_window_start | text | Start time of the window during which the backup will start. | |
private_ipv4 | inet | Private IPv4 address of the Droplet. | |
public_ipv4 | inet | Public IPv4 address of the Droplet. | |
public_ipv6 | inet | Public IPv6 address of the Droplet. | |
region | jsonb | Information about region that the Droplet instance is deployed in. | |
region_slug | text | The unique slug identifier for the region the Droplet is deployed in. | |
size | jsonb | Information 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_slug | text | The unique slug identifier for the size of this Droplet. | |
snapshot_ids | jsonb | An array of snapshot IDs of any snapshots created from the Droplet instance. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
status | text | A status string indicating the state of the Droplet instance. This may be "new", "active", "off", or "archive". | |
tags | jsonb | A map of tags for the resource. | |
tags_src | jsonb | An array of tags the Droplet has been tagged with. | |
title | text | Title of the resource. | |
urn | text | The uniform resource name (URN) for the Droplet. | |
vcpus | bigint | The number of virtual CPUs. | |
volume_ids | jsonb | A flat array including the unique identifier for each Block Storage volume attached to the Droplet. | |
vpc_uuid | text | A string specifying the UUID of the VPC to which the Droplet is assigned. |