turbot/gcp_insights

Query: kubernetes_clusters_for_compute_instance_group

Usage

powerpipe query gcp_insights.query.kubernetes_clusters_for_compute_instance_group

SQL

select
c.id::text || '/' || c.project as cluster_id
from
gcp_kubernetes_cluster c,
gcp_compute_instance_group g,
jsonb_array_elements_text(instance_group_urls) ig
where
split_part(ig, 'instanceGroupManagers/', 2) = g.name
and g.id = (split_part($1, '/', 1))::bigint
and g.project = split_part($1, '/', 2);