Oracle Cloud Infrastructure v0.20.0, May 31 23
Oracle Cloud Infrastructure v0.20.0, May 31 23
oci.Budget.getBudgets
Explore with Pulumi AI
This data source provides the list of Budgets in Oracle Cloud Infrastructure Budget service.
Gets a list of budgets in a compartment.
By default, ListBudgets returns budgets of the ‘COMPARTMENT’ target type, and the budget records with only one target compartment OCID.
To list all budgets, set the targetType query parameter to ALL (for example: ’targetType=ALL’).
Additional targetTypes would be available in future releases. Clients should ignore new targetTypes, or upgrade to the latest version of the client SDK to handle new targetTypes.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() =>
{
var testBudgets = Oci.Budget.GetBudgets.Invoke(new()
{
CompartmentId = @var.Tenancy_ocid,
DisplayName = @var.Budget_display_name,
State = @var.Budget_state,
TargetType = @var.Budget_target_type,
});
});
package main
import (
"github.com/pulumi/pulumi-oci/sdk/go/oci/Budget"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := Budget.GetBudgets(ctx, &budget.GetBudgetsArgs{
CompartmentId: _var.Tenancy_ocid,
DisplayName: pulumi.StringRef(_var.Budget_display_name),
State: pulumi.StringRef(_var.Budget_state),
TargetType: pulumi.StringRef(_var.Budget_target_type),
}, nil)
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Budget.BudgetFunctions;
import com.pulumi.oci.Budget.inputs.GetBudgetsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var testBudgets = BudgetFunctions.getBudgets(GetBudgetsArgs.builder()
.compartmentId(var_.tenancy_ocid())
.displayName(var_.budget_display_name())
.state(var_.budget_state())
.targetType(var_.budget_target_type())
.build());
}
}
import pulumi
import pulumi_oci as oci
test_budgets = oci.Budget.get_budgets(compartment_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
display_name=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
state=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
target_type=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testBudgets = oci.Budget.getBudgets({
compartmentId: _var.tenancy_ocid,
displayName: _var.budget_display_name,
state: _var.budget_state,
targetType: _var.budget_target_type,
});
variables:
testBudgets:
fn::invoke:
Function: oci:Budget:getBudgets
Arguments:
compartmentId: ${var.tenancy_ocid}
displayName: ${var.budget_display_name}
state: ${var.budget_state}
targetType: ${var.budget_target_type}
Using getBudgets
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getBudgets(args: GetBudgetsArgs, opts?: InvokeOptions): Promise<GetBudgetsResult>
function getBudgetsOutput(args: GetBudgetsOutputArgs, opts?: InvokeOptions): Output<GetBudgetsResult>
def get_budgets(compartment_id: Optional[str] = None,
display_name: Optional[str] = None,
filters: Optional[Sequence[_budget.GetBudgetsFilter]] = None,
state: Optional[str] = None,
target_type: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetBudgetsResult
def get_budgets_output(compartment_id: Optional[pulumi.Input[str]] = None,
display_name: Optional[pulumi.Input[str]] = None,
filters: Optional[pulumi.Input[Sequence[pulumi.Input[_budget.GetBudgetsFilterArgs]]]] = None,
state: Optional[pulumi.Input[str]] = None,
target_type: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetBudgetsResult]
func GetBudgets(ctx *Context, args *GetBudgetsArgs, opts ...InvokeOption) (*GetBudgetsResult, error)
func GetBudgetsOutput(ctx *Context, args *GetBudgetsOutputArgs, opts ...InvokeOption) GetBudgetsResultOutput
> Note: This function is named GetBudgets
in the Go SDK.
public static class GetBudgets
{
public static Task<GetBudgetsResult> InvokeAsync(GetBudgetsArgs args, InvokeOptions? opts = null)
public static Output<GetBudgetsResult> Invoke(GetBudgetsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetBudgetsResult> getBudgets(GetBudgetsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: oci:Budget/getBudgets:getBudgets
arguments:
# arguments dictionary
The following arguments are supported:
- Compartment
Id string The ID of the compartment in which to list resources.
- Display
Name string A user-friendly name. This does not have to be unique, and it's changeable. Example:
My new resource
- Filters
List<Get
Budgets Filter> - State string
The current state of the resource to filter by.
- Target
Type string The type of target to filter by:
- ALL - List all budgets
- COMPARTMENT - List all budgets with targetType == "COMPARTMENT"
- TAG - List all budgets with targetType == "TAG"
- Compartment
Id string The ID of the compartment in which to list resources.
- Display
Name string A user-friendly name. This does not have to be unique, and it's changeable. Example:
My new resource
- Filters
[]Get
Budgets Filter - State string
The current state of the resource to filter by.
- Target
Type string The type of target to filter by:
- ALL - List all budgets
- COMPARTMENT - List all budgets with targetType == "COMPARTMENT"
- TAG - List all budgets with targetType == "TAG"
- compartment
Id String The ID of the compartment in which to list resources.
- display
Name String A user-friendly name. This does not have to be unique, and it's changeable. Example:
My new resource
- filters
List<Gets
Filter> - state String
The current state of the resource to filter by.
- target
Type String The type of target to filter by:
- ALL - List all budgets
- COMPARTMENT - List all budgets with targetType == "COMPARTMENT"
- TAG - List all budgets with targetType == "TAG"
- compartment
Id string The ID of the compartment in which to list resources.
- display
Name string A user-friendly name. This does not have to be unique, and it's changeable. Example:
My new resource
- filters
Get
Budgets Filter[] - state string
The current state of the resource to filter by.
- target
Type string The type of target to filter by:
- ALL - List all budgets
- COMPARTMENT - List all budgets with targetType == "COMPARTMENT"
- TAG - List all budgets with targetType == "TAG"
- compartment_
id str The ID of the compartment in which to list resources.
- display_
name str A user-friendly name. This does not have to be unique, and it's changeable. Example:
My new resource
- filters
Get
Budgets Filter] - state str
The current state of the resource to filter by.
- target_
type str The type of target to filter by:
- ALL - List all budgets
- COMPARTMENT - List all budgets with targetType == "COMPARTMENT"
- TAG - List all budgets with targetType == "TAG"
- compartment
Id String The ID of the compartment in which to list resources.
- display
Name String A user-friendly name. This does not have to be unique, and it's changeable. Example:
My new resource
- filters List<Property Map>
- state String
The current state of the resource to filter by.
- target
Type String The type of target to filter by:
- ALL - List all budgets
- COMPARTMENT - List all budgets with targetType == "COMPARTMENT"
- TAG - List all budgets with targetType == "TAG"
getBudgets Result
The following output properties are available:
- Budgets
List<Get
Budgets Budget> The list of budgets.
- Compartment
Id string The OCID of the compartment.
- Id string
The provider-assigned unique ID for this managed resource.
- Display
Name string The display name of the budget. Avoid entering confidential information.
- Filters
List<Get
Budgets Filter> - State string
The current state of the budget.
- Target
Type string The type of target on which the budget is applied.
- Budgets
[]Get
Budgets Budget The list of budgets.
- Compartment
Id string The OCID of the compartment.
- Id string
The provider-assigned unique ID for this managed resource.
- Display
Name string The display name of the budget. Avoid entering confidential information.
- Filters
[]Get
Budgets Filter - State string
The current state of the budget.
- Target
Type string The type of target on which the budget is applied.
- budgets List<Gets>
The list of budgets.
- compartment
Id String The OCID of the compartment.
- id String
The provider-assigned unique ID for this managed resource.
- display
Name String The display name of the budget. Avoid entering confidential information.
- filters
List<Gets
Filter> - state String
The current state of the budget.
- target
Type String The type of target on which the budget is applied.
- budgets
Get
Budgets Budget[] The list of budgets.
- compartment
Id string The OCID of the compartment.
- id string
The provider-assigned unique ID for this managed resource.
- display
Name string The display name of the budget. Avoid entering confidential information.
- filters
Get
Budgets Filter[] - state string
The current state of the budget.
- target
Type string The type of target on which the budget is applied.
- budgets
Get
Budgets Budget] The list of budgets.
- compartment_
id str The OCID of the compartment.
- id str
The provider-assigned unique ID for this managed resource.
- display_
name str The display name of the budget. Avoid entering confidential information.
- filters
Get
Budgets Filter] - state str
The current state of the budget.
- target_
type str The type of target on which the budget is applied.
- budgets List<Property Map>
The list of budgets.
- compartment
Id String The OCID of the compartment.
- id String
The provider-assigned unique ID for this managed resource.
- display
Name String The display name of the budget. Avoid entering confidential information.
- filters List<Property Map>
- state String
The current state of the budget.
- target
Type String The type of target on which the budget is applied.
Supporting Types
GetBudgetsBudget
- Actual
Spend double The actual spend in currency for the current budget cycle.
- Alert
Rule intCount The total number of alert rules in the budget.
- Amount int
The amount of the budget, expressed in the currency of the customer's rate card.
- Budget
Processing intPeriod Start Offset The number of days offset from the first day of the month, at which the budget processing period starts. In months that have fewer days than this value, processing will begin on the last day of that month. For example, for a value of 12, processing starts every month on the 12th at midnight.
- Compartment
Id string The ID of the compartment in which to list resources.
- Dictionary<string, object>
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"}
- Description string
The description of the budget.
- Display
Name string A user-friendly name. This does not have to be unique, and it's changeable. Example:
My new resource
- Forecasted
Spend double The forecasted spend in currency by the end of the current budget cycle.
- Dictionary<string, object>
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"}
- Id string
The OCID of the budget.
- Processing
Period stringType The type of the budget processing period. Valid values are INVOICE and MONTH.
- Reset
Period string The reset period for the budget.
- State string
The current state of the resource to filter by.
- Target
Compartment stringId This is DEPRECATED. For backwards compatability, the property is populated when the targetType is "COMPARTMENT", and targets contain the specific target compartment OCID. For all other scenarios, this property will be left empty.
The 'target_compartment_id' field has been deprecated. Please use 'target_type' instead.
- Target
Type string The type of target to filter by:
- ALL - List all budgets
- COMPARTMENT - List all budgets with targetType == "COMPARTMENT"
- TAG - List all budgets with targetType == "TAG"
- Targets List<string>
The list of targets on which the budget is applied. If the targetType is "COMPARTMENT", the targets contain the list of compartment OCIDs. If the targetType is "TAG", the targets contain the list of cost tracking tag identifiers in the form of "{tagNamespace}.{tagKey}.{tagValue}".
- Time
Created string The time that the budget was created.
- Time
Spend stringComputed The time that the budget spend was last computed.
- Time
Updated string The time that the budget was updated.
- Version int
The version of the budget. Starts from 1 and increments by 1.
- Actual
Spend float64 The actual spend in currency for the current budget cycle.
- Alert
Rule intCount The total number of alert rules in the budget.
- Amount int
The amount of the budget, expressed in the currency of the customer's rate card.
- Budget
Processing intPeriod Start Offset The number of days offset from the first day of the month, at which the budget processing period starts. In months that have fewer days than this value, processing will begin on the last day of that month. For example, for a value of 12, processing starts every month on the 12th at midnight.
- Compartment
Id string The ID of the compartment in which to list resources.
- map[string]interface{}
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"}
- Description string
The description of the budget.
- Display
Name string A user-friendly name. This does not have to be unique, and it's changeable. Example:
My new resource
- Forecasted
Spend float64 The forecasted spend in currency by the end of the current budget cycle.
- map[string]interface{}
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"}
- Id string
The OCID of the budget.
- Processing
Period stringType The type of the budget processing period. Valid values are INVOICE and MONTH.
- Reset
Period string The reset period for the budget.
- State string
The current state of the resource to filter by.
- Target
Compartment stringId This is DEPRECATED. For backwards compatability, the property is populated when the targetType is "COMPARTMENT", and targets contain the specific target compartment OCID. For all other scenarios, this property will be left empty.
The 'target_compartment_id' field has been deprecated. Please use 'target_type' instead.
- Target
Type string The type of target to filter by:
- ALL - List all budgets
- COMPARTMENT - List all budgets with targetType == "COMPARTMENT"
- TAG - List all budgets with targetType == "TAG"
- Targets []string
The list of targets on which the budget is applied. If the targetType is "COMPARTMENT", the targets contain the list of compartment OCIDs. If the targetType is "TAG", the targets contain the list of cost tracking tag identifiers in the form of "{tagNamespace}.{tagKey}.{tagValue}".
- Time
Created string The time that the budget was created.
- Time
Spend stringComputed The time that the budget spend was last computed.
- Time
Updated string The time that the budget was updated.
- Version int
The version of the budget. Starts from 1 and increments by 1.
- actual
Spend Double The actual spend in currency for the current budget cycle.
- alert
Rule IntegerCount The total number of alert rules in the budget.
- amount Integer
The amount of the budget, expressed in the currency of the customer's rate card.
- budget
Processing IntegerPeriod Start Offset The number of days offset from the first day of the month, at which the budget processing period starts. In months that have fewer days than this value, processing will begin on the last day of that month. For example, for a value of 12, processing starts every month on the 12th at midnight.
- compartment
Id String The ID of the compartment in which to list resources.
- Map<String,Object>
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"}
- description String
The description of the budget.
- display
Name String A user-friendly name. This does not have to be unique, and it's changeable. Example:
My new resource
- forecasted
Spend Double The forecasted spend in currency by the end of the current budget cycle.
- Map<String,Object>
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"}
- id String
The OCID of the budget.
- processing
Period StringType The type of the budget processing period. Valid values are INVOICE and MONTH.
- reset
Period String The reset period for the budget.
- state String
The current state of the resource to filter by.
- target
Compartment StringId This is DEPRECATED. For backwards compatability, the property is populated when the targetType is "COMPARTMENT", and targets contain the specific target compartment OCID. For all other scenarios, this property will be left empty.
The 'target_compartment_id' field has been deprecated. Please use 'target_type' instead.
- target
Type String The type of target to filter by:
- ALL - List all budgets
- COMPARTMENT - List all budgets with targetType == "COMPARTMENT"
- TAG - List all budgets with targetType == "TAG"
- targets List<String>
The list of targets on which the budget is applied. If the targetType is "COMPARTMENT", the targets contain the list of compartment OCIDs. If the targetType is "TAG", the targets contain the list of cost tracking tag identifiers in the form of "{tagNamespace}.{tagKey}.{tagValue}".
- time
Created String The time that the budget was created.
- time
Spend StringComputed The time that the budget spend was last computed.
- time
Updated String The time that the budget was updated.
- version Integer
The version of the budget. Starts from 1 and increments by 1.
- actual
Spend number The actual spend in currency for the current budget cycle.
- alert
Rule numberCount The total number of alert rules in the budget.
- amount number
The amount of the budget, expressed in the currency of the customer's rate card.
- budget
Processing numberPeriod Start Offset The number of days offset from the first day of the month, at which the budget processing period starts. In months that have fewer days than this value, processing will begin on the last day of that month. For example, for a value of 12, processing starts every month on the 12th at midnight.
- compartment
Id string The ID of the compartment in which to list resources.
- {[key: string]: any}
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"}
- description string
The description of the budget.
- display
Name string A user-friendly name. This does not have to be unique, and it's changeable. Example:
My new resource
- forecasted
Spend number The forecasted spend in currency by the end of the current budget cycle.
- {[key: string]: any}
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"}
- id string
The OCID of the budget.
- processing
Period stringType The type of the budget processing period. Valid values are INVOICE and MONTH.
- reset
Period string The reset period for the budget.
- state string
The current state of the resource to filter by.
- target
Compartment stringId This is DEPRECATED. For backwards compatability, the property is populated when the targetType is "COMPARTMENT", and targets contain the specific target compartment OCID. For all other scenarios, this property will be left empty.
The 'target_compartment_id' field has been deprecated. Please use 'target_type' instead.
- target
Type string The type of target to filter by:
- ALL - List all budgets
- COMPARTMENT - List all budgets with targetType == "COMPARTMENT"
- TAG - List all budgets with targetType == "TAG"
- targets string[]
The list of targets on which the budget is applied. If the targetType is "COMPARTMENT", the targets contain the list of compartment OCIDs. If the targetType is "TAG", the targets contain the list of cost tracking tag identifiers in the form of "{tagNamespace}.{tagKey}.{tagValue}".
- time
Created string The time that the budget was created.
- time
Spend stringComputed The time that the budget spend was last computed.
- time
Updated string The time that the budget was updated.
- version number
The version of the budget. Starts from 1 and increments by 1.
- actual_
spend float The actual spend in currency for the current budget cycle.
- alert_
rule_ intcount The total number of alert rules in the budget.
- amount int
The amount of the budget, expressed in the currency of the customer's rate card.
- budget_
processing_ intperiod_ start_ offset The number of days offset from the first day of the month, at which the budget processing period starts. In months that have fewer days than this value, processing will begin on the last day of that month. For example, for a value of 12, processing starts every month on the 12th at midnight.
- compartment_
id str The ID of the compartment in which to list resources.
- Mapping[str, Any]
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"}
- description str
The description of the budget.
- display_
name str A user-friendly name. This does not have to be unique, and it's changeable. Example:
My new resource
- forecasted_
spend float The forecasted spend in currency by the end of the current budget cycle.
- Mapping[str, Any]
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"}
- id str
The OCID of the budget.
- processing_
period_ strtype The type of the budget processing period. Valid values are INVOICE and MONTH.
- reset_
period str The reset period for the budget.
- state str
The current state of the resource to filter by.
- target_
compartment_ strid This is DEPRECATED. For backwards compatability, the property is populated when the targetType is "COMPARTMENT", and targets contain the specific target compartment OCID. For all other scenarios, this property will be left empty.
The 'target_compartment_id' field has been deprecated. Please use 'target_type' instead.
- target_
type str The type of target to filter by:
- ALL - List all budgets
- COMPARTMENT - List all budgets with targetType == "COMPARTMENT"
- TAG - List all budgets with targetType == "TAG"
- targets Sequence[str]
The list of targets on which the budget is applied. If the targetType is "COMPARTMENT", the targets contain the list of compartment OCIDs. If the targetType is "TAG", the targets contain the list of cost tracking tag identifiers in the form of "{tagNamespace}.{tagKey}.{tagValue}".
- time_
created str The time that the budget was created.
- time_
spend_ strcomputed The time that the budget spend was last computed.
- time_
updated str The time that the budget was updated.
- version int
The version of the budget. Starts from 1 and increments by 1.
- actual
Spend Number The actual spend in currency for the current budget cycle.
- alert
Rule NumberCount The total number of alert rules in the budget.
- amount Number
The amount of the budget, expressed in the currency of the customer's rate card.
- budget
Processing NumberPeriod Start Offset The number of days offset from the first day of the month, at which the budget processing period starts. In months that have fewer days than this value, processing will begin on the last day of that month. For example, for a value of 12, processing starts every month on the 12th at midnight.
- compartment
Id String The ID of the compartment in which to list resources.
- Map<Any>
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"}
- description String
The description of the budget.
- display
Name String A user-friendly name. This does not have to be unique, and it's changeable. Example:
My new resource
- forecasted
Spend Number The forecasted spend in currency by the end of the current budget cycle.
- Map<Any>
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"}
- id String
The OCID of the budget.
- processing
Period StringType The type of the budget processing period. Valid values are INVOICE and MONTH.
- reset
Period String The reset period for the budget.
- state String
The current state of the resource to filter by.
- target
Compartment StringId This is DEPRECATED. For backwards compatability, the property is populated when the targetType is "COMPARTMENT", and targets contain the specific target compartment OCID. For all other scenarios, this property will be left empty.
The 'target_compartment_id' field has been deprecated. Please use 'target_type' instead.
- target
Type String The type of target to filter by:
- ALL - List all budgets
- COMPARTMENT - List all budgets with targetType == "COMPARTMENT"
- TAG - List all budgets with targetType == "TAG"
- targets List<String>
The list of targets on which the budget is applied. If the targetType is "COMPARTMENT", the targets contain the list of compartment OCIDs. If the targetType is "TAG", the targets contain the list of cost tracking tag identifiers in the form of "{tagNamespace}.{tagKey}.{tagValue}".
- time
Created String The time that the budget was created.
- time
Spend StringComputed The time that the budget spend was last computed.
- time
Updated String The time that the budget was updated.
- version Number
The version of the budget. Starts from 1 and increments by 1.
GetBudgetsFilter
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
oci
Terraform Provider.