turbot/oci_thrifty
Loading controls...

Control: Block and Boot volumes should be resized if too large

Description

Large core volumes are unusual, expensive and should be reviewed.

Usage

Run the control in your terminal:

powerpipe control run oci_thrifty.control.boot_and_block_volume_large

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run oci_thrifty.control.boot_and_block_volume_large --share

Steampipe Tables

Params

ArgsNameDefaultDescriptionVariable
$1boot_and_block_volume_max_size_gb
100
The maximum size (GB) allowed for boot and block volumes.

SQL

with all_volumes_with_size as (
select
id,
_ctx,
tenant_id,
compartment_id,
region,
display_name,
lifecycle_state,
size_in_gbs
from
oci_core_volume
union
select
id,
_ctx,
tenant_id,
compartment_id,
region,
display_name,
lifecycle_state,
size_in_gbs
from
oci_core_boot_volume
)
select
a.id as resource,
case
when a.size_in_gbs <= $1 then 'ok'
else 'alarm'
end as status,
a.display_name || ' with size ' || a.size_in_gbs || ' gb.' as reason,
coalesce(c.name, 'root') as compartment,
a.region
from
all_volumes_with_size as a
left join oci_identity_compartment as c on c.id = a.compartment_id
where
a.lifecycle_state <> 'TERMINATED';

Tags