steampipe plugin install fly

Table: fly_volume - Query Fly.io Volumes using SQL

Fly.io Volumes are block storage devices that can be attached to apps for persistent data storage. They provide a way to store data that persists across deployments and restarts, and can be shared between instances of an app. Volumes are attached to a specific region and can be moved between regions if needed.

Table Usage Guide

The fly_volume table provides insights into volumes within Fly.io. As a developer or system administrator, explore volume-specific details through this table, including the attached app, size, and region. Utilize it to manage and monitor your persistent data storage across different regions and applications.

Examples

Basic info

Explore which volumes in your system are encrypted and their respective statuses across different regions. This can help secure your data by identifying any unencrypted volumes that may pose a security risk.

select
name,
id,
status,
encrypted,
region
from
fly_volume;
select
name,
id,
status,
encrypted,
region
from
fly_volume;

List unencrypted volumes

Uncover the details of unencrypted volumes within your system to enhance your data security. This query provides a tool to identify potential vulnerabilities and take corrective actions.

select
name,
id,
status,
region
from
fly_volume
where
not encrypted;
select
name,
id,
status,
region
from
fly_volume
where
encrypted = 0;

List unused volumes

Identify unutilized storage volumes that are not attached to any machine, providing insights into potential cost savings or optimization opportunities in your cloud infrastructure.

select
name,
id,
status,
region,
attached_machine_id
from
fly_volume
where
attached_machine_id = '';
select
name,
id,
status,
region,
attached_machine_id
from
fly_volume
where
attached_machine_id = '';

List of volumes with size more than 100GiB

Explore which volumes exceed 100GiB in size. This is beneficial for managing storage resources and identifying potential areas for data reduction or redistribution.

select
name,
id,
status,
region,
size_gb
from
fly_volume
where
size_gb > '100';
select
name,
id,
status,
region,
size_gb
from
fly_volume
where
size_gb > 100;

List volumes attached to suspended applications

Discover the segments that have volumes connected to applications that are currently inactive. This can be useful in identifying resources that may be unnecessarily occupied, thus optimizing resource utilization.

select
v.name,
v.size_gb,
a.id
from
fly_volume as v
join fly_app as a on v.app_id = a.id
and a.status = 'suspended';
select
v.name,
v.size_gb,
a.id
from
fly_volume as v
join fly_app as a on v.app_id = a.id
where
a.status = 'suspended';

Schema for fly_volume

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
app_idtextSpecifies the ID of the application.
attached_machine_idtextSpecifies the ID of the machine; the volume is attached.
created_attimestamp with time zoneThe timestamp when the volume was created.
encryptedbooleanIf true, the volume is encrypted.
host_idtextSpecifies the volume host ID.
idtext=A unique identifier of the volume.
internal_idtextSpecifies the internal ID of the volume.
nametextThe name of the volume.
regiontextThe region where the volume is created.
size_gbbigintSpecifies the size of the volume.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
statetextThe configuration state of the volume.
statustextThe current status of the volume.
used_bytestextSpecifies the amount of storage used in bytes.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- fly

You can pass the configuration to the command with the --config argument:

steampipe_export_fly --config '<your_config>' fly_volume