Table: oci_budget_budget - Query OCI Budgets using SQL
Oracle Cloud Infrastructure's Budgets service allows users to set thresholds that trigger alerts when cost and usage go beyond the set amount. This service helps users to control costs in their tenancy by providing a way to monitor and manage the consumption of resources. It provides a mechanism to keep track of your OCI spending and ensure it stays within the budget.
Table Usage Guide
The oci_budget_budget
table provides insights into budget details within Oracle Cloud Infrastructure's Budgets service. As a finance or operations professional, explore budget-specific details through this table, including the amount, actual spend, and forecasted spend. Utilize it to monitor and manage the consumption of OCI resources, ensuring that spending stays within the defined budget.
Examples
Basic info
Gain insights into your budgeting by analyzing the state, amount, and actual spending of your Oracle Cloud Infrastructure resources. This helps in understanding the financial aspects of your resources and planning future expenses accordingly.
select display_name, id, amount, actual_spend, lifecycle_state as statefrom oci_budget_budget;
select display_name, id, amount, actual_spend, lifecycle_state as statefrom oci_budget_budget;
List budgets that are not active
Discover the segments that are not currently active in your budget. This can be useful to identify areas where resources are being allocated but are not currently in use, helping to optimize your budget distribution.
select display_name, id, amount, actual_spend, lifecycle_state as statefrom oci_budget_budgetwhere lifecycle_state <> 'ACTIVE';
select display_name, id, amount, actual_spend, lifecycle_state as statefrom oci_budget_budgetwhere lifecycle_state <> 'ACTIVE';
List budgets with actual spend more than 100 percent
Discover segments where the actual expenditure has exceeded the allocated budget. This is particularly useful for identifying and analyzing areas of overspending to facilitate more effective budget management.
select display_name, id, amount, actual_spend, lifecycle_state as statefrom oci_budget_budgetwhere actual_spend > amount;
select display_name, id, amount, actual_spend, lifecycle_state as statefrom oci_budget_budgetwhere actual_spend > amount;
Schema for oci_budget_budget
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
actual_spend | double precision | The actual spend in currency for the current budget cycle. | |
alert_rule_count | bigint | Total number of alert rules in the budget. | |
amount | double precision | The amount of the budget expressed in the currency of the customer's rate card. | |
budget_processing_period_start_offset | bigint | The number of days offset from the first day of the month, at which the budget processing period starts. | |
compartment_id | text | = | The OCID of the compartment in Tenant in which the resource is located. |
defined_tags | jsonb | Defined tags for resource. Defined tags are set up in your tenancy by an administrator. Only users granted permission to work with the defined tags can apply them to resources. | |
description | text | The description of the budget. | |
display_name | text | = | The display name of the budget. |
forecasted_spend | double precision | The forecasted spend in currency by the end of the current budget cycle. | |
freeform_tags | jsonb | Free-form tags for resource. This tags can be applied by any user with permissions on the resource. | |
id | text | = | The OCID of the budget. |
lifecycle_state | text | = | The current state of the budget. |
reset_period | text | The reset period for the budget. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
tags | jsonb | A map of tags for the resource. | |
target_compartment_id | text | This is DEPRECATED. For backwards compatability, the property will be populated when targetType is COMPARTMENT AND targets contains EXACT ONE target compartment ocid. For all other scenarios, this property will be left empty. | |
target_type | text | The type of target on which the budget is applied. | |
targets | jsonb | The list of targets on which the budget is applied. | |
tenant_id | text | =, !=, ~~, ~~*, !~~, !~~* | The OCID of the Tenant in which the resource is located. |
tenant_name | text | The name of the Tenant in which the resource is located. | |
time_created | timestamp with time zone | Time that budget was created. | |
time_spend_computed | timestamp with time zone | The time that the budget spend was last computed. | |
time_updated | timestamp with time zone | Time that budget was updated. | |
title | text | Title of the resource. | |
version | bigint | Version of the budget. Starts from 1 and increments by 1. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- oci
You can pass the configuration to the command with the --config
argument:
steampipe_export_oci --config '<your_config>' oci_budget_budget