Control: Compute disks should not exceed label limit
Description
Check if the number of labels on Compute disks do not exceed the limit.
Usage
Run the control in your terminal:
powerpipe control run gcp_labels.control.compute_disk_label_limitSnapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run gcp_labels.control.compute_disk_label_limit --shareSteampipe Tables
SQL
with analysis as (  select    self_link,    title,    cardinality(array(select jsonb_object_keys(labels))) as num_label_keys,    location, project  from    gcp_compute_disk)select  self_link as resource,  case    when num_label_keys > $1::integer then 'alarm'    else 'ok'  end as status,  title || ' has ' || num_label_keys || ' label(s).' as reason,  location, projectfrom  analysis
Params
| Args | Name | Default | Description | Variable | 
|---|---|---|---|---|
| $1 | label_limit |  |