table gcp_compute_machine_type not support t2a machine type query
Closed this issue ยท 10 comments
Describe the bug
table gcp_compute_machine_type not support t2a machine type query
Steampipe version (steampipe -v
)
0.20.9
Plugin version (steampipe plugin list
)
v0.40.0
To reproduce
execute:
steampipe query "select * from gcp_compute_machine_type where name = 't2a-standard-2'" --output line
Expected behavior
Table gcp_compute_machine_type returns t2a-standard-2 machine type records.
Additional context
Returns nothing.
#465 Update zone to us-central1-a to support query t2a machine type to fix this issue
@rajlearner17 Checked with gcp official doc again, I changed pr to use uc-central1-a, which covered all machine types in this zone : https://cloud.google.com/compute/docs/regions-zones#quotas
yes, change to us-centra1-a is the fastest fix, as I known.
If machine types are tied to zones, I wonder if the table should instead use a ParentHydrate
to list zones, and then list machine types for each zone? If you then run select * from gcp_compute_machine_type
, then it'd list all machine types for all zones, but you could limit results with distinct
or distinct on
.
CC @ParthaI
@cbruno10 -- After digging into this, below are the points I would like to bring upon
- We cannot assume that all the machine types returned by the table are supported in all zones.
- We can list the available machine types per zone using the parent hydrate, but this approach might result in duplicate data.
- We can determine which machine types are supported in each zone.
Based on your suggestion, we get the following result using the parent hydrate (with my local change).
> select count(name) from gcp_compute_machine_type
+-------+
| count |
+-------+
| 13141 |
+-------+
> select count(distinct name) from gcp_compute_machine_type
+-------+
| count |
+-------+
| 203 |
+-------+
In my opinion, from a design perspective, it would be beneficial to structure the table as follows:
- The table will use the zone as parent hydrate.
- An additional column named
zone_name
will be added to the tablegcp_compute_machine_type
- The list config will include an optional key column,
zone_name
. - If
zone_name
is specified, API calls will be restricted to that particular zone. - The get configuration will require two key columns:
name
andzone_name
.
Please let me know if this approach is acceptable, or we further connect to discuss. Thank you!