Control: Budget alerts should be set for each compartment
Budget alerts should be set for each compartment, including the root compartment, to monitor costs.
Run the control in your terminal:
steampipe check oci_thrifty.control.budget_alert_count
Snapshot and share results via Steampipe Cloud:
steampipe loginsteampipe check --share oci_thrifty.control.budget_alert_count
Plugins & Tables
with compartment_with_budget as (selectid,'root' as name,'ACTIVE' as lifecycle_state,tenant_id,_ctxfromoci_identity_tenancyunionselectid,name,lifecycle_state,tenant_id,_ctxfromoci_identity_compartment)selectc.id as resource,casewhen a.alert_rule_count is null then 'alarm'when a.alert_rule_count >= 1and a.reset_period = 'MONTHLY' then 'ok'else 'alarm'end as status,casewhen a.alert_rule_count is null then c.name || ' has no scheduled budget.'else a.display_name || ' has scheduled budget with ' || a.reset_period || ' reset period.'end as reason,coalesce(c.name, 'root') as compartmentfromcompartment_with_budget as cleft join oci_budget_budget as a on a.targets ? & array [ c.id ]wherec.lifecycle_state = 'ACTIVE';