Table: fly_machine - Query Fly.io Machines using SQL
Fly.io is a platform for running application servers close to users. It provides a global application runtime that allows deployment of applications to any city in the world. This service enables users to run their applications on a collection of virtual machines called 'Machines'.
Table Usage Guide
The fly_machine
table provides insights into Machines within the Fly.io platform. As a developer or system administrator, explore machine-specific details through this table, including their status, region, and associated applications. Utilize it to uncover information about machines, such as those in a particular region, the status of machines, and the applications they are associated with.
Examples
Basic info
Explore the status and location of various machines in your fleet to understand their operational distribution and longevity. This could be useful for assessing the need for new purchases or redistributions based on regional demands and machine age.
select name, id, state, region, created_atfrom fly_machine;
select name, id, state, region, created_atfrom fly_machine;
List stopped machines
Discover the segments that consist of halted machines, allowing you to analyze your resources and optimize accordingly. This is useful in managing resource allocation and preventing unnecessary costs associated with idle machines.
select name, id, state, region, created_atfrom fly_machinewhere state = 'stopped';
select name, id, state, region, created_atfrom fly_machinewhere state = 'stopped';
List machines by app
Discover the segments that are associated with a specific application by analyzing the state, region, and creation date of each machine. This can be useful in managing resources and tracking the performance of different applications.
select name, id, state, region, created_atfrom fly_machinewhere app_id = 'fly-builder-icy-tree-3230';
select name, id, state, region, created_atfrom fly_machinewhere app_id = 'fly-builder-icy-tree-3230';
List unencrypted volumes attached to the machines
Discover the segments that consist of machines with unencrypted volumes attached to them. This is beneficial for identifying potential security risks in your system.
select m.name as machine, v.name as volume, v.encryptedfrom fly_machine as m, jsonb_array_elements(config -> 'mounts') as mount join fly_volume as v on v.id = mount ->> 'volume' and not v.encrypted;
select m.name as machine, v.name as volume, v.encryptedfrom fly_machine as m, json_each(m.config, '$.mounts') as mount join fly_volume as v on v.id = json_extract(mount.value, '$.volume') and not v.encrypted;
Schema for fly_machine
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
app_id | text | = | Specifies the application. |
config | jsonb | Specifies the machine configuration. | |
created_at | timestamp with time zone | The timestamp when the machine was created. | |
host_id | text | Specifies the machine host ID. | |
id | text | = | A unique identifier of the machine. |
instance_id | text | Specifies the instance ID. | |
name | text | The name of the machine. | |
region | text | The region where the machine is created. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
state | text | = | The current status of the machine. |
updated_at | timestamp with time zone | The timestamp when the machine was last modified. |
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_machine