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, regionfrom fly_volume;
select name, id, status, encrypted, regionfrom 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, regionfrom fly_volumewhere not encrypted;
select name, id, status, regionfrom fly_volumewhere 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_idfrom fly_volumewhere attached_machine_id = '';
select name, id, status, region, attached_machine_idfrom fly_volumewhere 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_gbfrom fly_volumewhere size_gb > '100';
select name, id, status, region, size_gbfrom fly_volumewhere 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.idfrom 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.idfrom fly_volume as v join fly_app as a on v.app_id = a.idwhere a.status = 'suspended';
Schema for fly_volume
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
app_id | text | Specifies the ID of the application. | |
attached_machine_id | text | Specifies the ID of the machine; the volume is attached. | |
created_at | timestamp with time zone | The timestamp when the volume was created. | |
encrypted | boolean | If true, the volume is encrypted. | |
host_id | text | Specifies the volume host ID. | |
id | text | = | A unique identifier of the volume. |
internal_id | text | Specifies the internal ID of the volume. | |
name | text | The name of the volume. | |
region | text | The region where the volume is created. | |
size_gb | bigint | Specifies the size of the volume. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
state | text | The configuration state of the volume. | |
status | text | The current status of the volume. | |
used_bytes | text | Specifies 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