1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Budget
  5. getAlertRules
Oracle Cloud Infrastructure v2.29.0 published on Wednesday, Apr 9, 2025 by Pulumi

oci.Budget.getAlertRules

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.29.0 published on Wednesday, Apr 9, 2025 by Pulumi

This data source provides the list of Alert Rules in Oracle Cloud Infrastructure Budget service.

Returns a list of Alert Rules for a specified budget.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testAlertRules = oci.Budget.getAlertRules({
    budgetId: testBudget.id,
    displayName: alertRuleDisplayName,
    state: alertRuleState,
});
Copy
import pulumi
import pulumi_oci as oci

test_alert_rules = oci.Budget.get_alert_rules(budget_id=test_budget["id"],
    display_name=alert_rule_display_name,
    state=alert_rule_state)
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/budget"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := budget.GetAlertRules(ctx, &budget.GetAlertRulesArgs{
			BudgetId:    testBudget.Id,
			DisplayName: pulumi.StringRef(alertRuleDisplayName),
			State:       pulumi.StringRef(alertRuleState),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testAlertRules = Oci.Budget.GetAlertRules.Invoke(new()
    {
        BudgetId = testBudget.Id,
        DisplayName = alertRuleDisplayName,
        State = alertRuleState,
    });

});
Copy
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.GetAlertRulesArgs;
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 testAlertRules = BudgetFunctions.getAlertRules(GetAlertRulesArgs.builder()
            .budgetId(testBudget.id())
            .displayName(alertRuleDisplayName)
            .state(alertRuleState)
            .build());

    }
}
Copy
variables:
  testAlertRules:
    fn::invoke:
      function: oci:Budget:getAlertRules
      arguments:
        budgetId: ${testBudget.id}
        displayName: ${alertRuleDisplayName}
        state: ${alertRuleState}
Copy

Using getAlertRules

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 getAlertRules(args: GetAlertRulesArgs, opts?: InvokeOptions): Promise<GetAlertRulesResult>
function getAlertRulesOutput(args: GetAlertRulesOutputArgs, opts?: InvokeOptions): Output<GetAlertRulesResult>
Copy
def get_alert_rules(budget_id: Optional[str] = None,
                    display_name: Optional[str] = None,
                    filters: Optional[Sequence[_budget.GetAlertRulesFilter]] = None,
                    state: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetAlertRulesResult
def get_alert_rules_output(budget_id: Optional[pulumi.Input[str]] = None,
                    display_name: Optional[pulumi.Input[str]] = None,
                    filters: Optional[pulumi.Input[Sequence[pulumi.Input[_budget.GetAlertRulesFilterArgs]]]] = None,
                    state: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetAlertRulesResult]
Copy
func GetAlertRules(ctx *Context, args *GetAlertRulesArgs, opts ...InvokeOption) (*GetAlertRulesResult, error)
func GetAlertRulesOutput(ctx *Context, args *GetAlertRulesOutputArgs, opts ...InvokeOption) GetAlertRulesResultOutput
Copy

> Note: This function is named GetAlertRules in the Go SDK.

public static class GetAlertRules 
{
    public static Task<GetAlertRulesResult> InvokeAsync(GetAlertRulesArgs args, InvokeOptions? opts = null)
    public static Output<GetAlertRulesResult> Invoke(GetAlertRulesInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetAlertRulesResult> getAlertRules(GetAlertRulesArgs args, InvokeOptions options)
public static Output<GetAlertRulesResult> getAlertRules(GetAlertRulesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:Budget/getAlertRules:getAlertRules
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

BudgetId This property is required. string
The unique budget OCID.
DisplayName string
A user-friendly name. This does not have to be unique, and it's changeable. Example: My new resource
Filters Changes to this property will trigger replacement. List<GetAlertRulesFilter>
State string
The current state of the resource to filter by.
BudgetId This property is required. string
The unique budget OCID.
DisplayName string
A user-friendly name. This does not have to be unique, and it's changeable. Example: My new resource
Filters Changes to this property will trigger replacement. []GetAlertRulesFilter
State string
The current state of the resource to filter by.
budgetId This property is required. String
The unique budget OCID.
displayName String
A user-friendly name. This does not have to be unique, and it's changeable. Example: My new resource
filters Changes to this property will trigger replacement. List<GetAlertRulesFilter>
state String
The current state of the resource to filter by.
budgetId This property is required. string
The unique budget OCID.
displayName string
A user-friendly name. This does not have to be unique, and it's changeable. Example: My new resource
filters Changes to this property will trigger replacement. GetAlertRulesFilter[]
state string
The current state of the resource to filter by.
budget_id This property is required. str
The unique budget OCID.
display_name str
A user-friendly name. This does not have to be unique, and it's changeable. Example: My new resource
filters Changes to this property will trigger replacement. Sequence[budget.GetAlertRulesFilter]
state str
The current state of the resource to filter by.
budgetId This property is required. String
The unique budget OCID.
displayName String
A user-friendly name. This does not have to be unique, and it's changeable. Example: My new resource
filters Changes to this property will trigger replacement. List<Property Map>
state String
The current state of the resource to filter by.

getAlertRules Result

The following output properties are available:

AlertRules List<GetAlertRulesAlertRule>
The list of alert_rules.
BudgetId string
The OCID of the budget.
Id string
The provider-assigned unique ID for this managed resource.
DisplayName string
The name of the alert rule. Avoid entering confidential information.
Filters List<GetAlertRulesFilter>
State string
The current state of the alert rule.
AlertRules []GetAlertRulesAlertRule
The list of alert_rules.
BudgetId string
The OCID of the budget.
Id string
The provider-assigned unique ID for this managed resource.
DisplayName string
The name of the alert rule. Avoid entering confidential information.
Filters []GetAlertRulesFilter
State string
The current state of the alert rule.
alertRules List<GetAlertRulesAlertRule>
The list of alert_rules.
budgetId String
The OCID of the budget.
id String
The provider-assigned unique ID for this managed resource.
displayName String
The name of the alert rule. Avoid entering confidential information.
filters List<GetAlertRulesFilter>
state String
The current state of the alert rule.
alertRules GetAlertRulesAlertRule[]
The list of alert_rules.
budgetId string
The OCID of the budget.
id string
The provider-assigned unique ID for this managed resource.
displayName string
The name of the alert rule. Avoid entering confidential information.
filters GetAlertRulesFilter[]
state string
The current state of the alert rule.
alert_rules Sequence[budget.GetAlertRulesAlertRule]
The list of alert_rules.
budget_id str
The OCID of the budget.
id str
The provider-assigned unique ID for this managed resource.
display_name str
The name of the alert rule. Avoid entering confidential information.
filters Sequence[budget.GetAlertRulesFilter]
state str
The current state of the alert rule.
alertRules List<Property Map>
The list of alert_rules.
budgetId String
The OCID of the budget.
id String
The provider-assigned unique ID for this managed resource.
displayName String
The name of the alert rule. Avoid entering confidential information.
filters List<Property Map>
state String
The current state of the alert rule.

Supporting Types

GetAlertRulesAlertRule

BudgetId This property is required. string
The unique budget OCID.
DefinedTags This property is required. Dictionary<string, string>
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 This property is required. string
The description of the alert rule.
DisplayName This property is required. string
A user-friendly name. This does not have to be unique, and it's changeable. Example: My new resource
FreeformTags This property is required. Dictionary<string, string>
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 This property is required. string
The OCID of the alert rule.
Message This property is required. string
The custom message that will be sent when the alert is triggered.
Recipients This property is required. string
The delimited list of email addresses to receive the alert when it triggers. Delimiter characters can be a comma, space, TAB, or semicolon.
State This property is required. string
The current state of the resource to filter by.
Threshold This property is required. double
The threshold for triggering the alert. If the thresholdType is PERCENTAGE, the maximum value is 10000.
ThresholdType This property is required. string
The type of threshold.
TimeCreated This property is required. string
The time when the budget was created.
TimeUpdated This property is required. string
The time when the budget was updated.
Type This property is required. string
The type of the alert. Valid values are ACTUAL (the alert triggers based on actual usage), or FORECAST (the alert triggers based on predicted usage).
Version This property is required. int
The version of the alert rule. Starts from 1 and increments by 1.
BudgetId This property is required. string
The unique budget OCID.
DefinedTags This property is required. map[string]string
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 This property is required. string
The description of the alert rule.
DisplayName This property is required. string
A user-friendly name. This does not have to be unique, and it's changeable. Example: My new resource
FreeformTags This property is required. map[string]string
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 This property is required. string
The OCID of the alert rule.
Message This property is required. string
The custom message that will be sent when the alert is triggered.
Recipients This property is required. string
The delimited list of email addresses to receive the alert when it triggers. Delimiter characters can be a comma, space, TAB, or semicolon.
State This property is required. string
The current state of the resource to filter by.
Threshold This property is required. float64
The threshold for triggering the alert. If the thresholdType is PERCENTAGE, the maximum value is 10000.
ThresholdType This property is required. string
The type of threshold.
TimeCreated This property is required. string
The time when the budget was created.
TimeUpdated This property is required. string
The time when the budget was updated.
Type This property is required. string
The type of the alert. Valid values are ACTUAL (the alert triggers based on actual usage), or FORECAST (the alert triggers based on predicted usage).
Version This property is required. int
The version of the alert rule. Starts from 1 and increments by 1.
budgetId This property is required. String
The unique budget OCID.
definedTags This property is required. Map<String,String>
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 This property is required. String
The description of the alert rule.
displayName This property is required. String
A user-friendly name. This does not have to be unique, and it's changeable. Example: My new resource
freeformTags This property is required. Map<String,String>
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 This property is required. String
The OCID of the alert rule.
message This property is required. String
The custom message that will be sent when the alert is triggered.
recipients This property is required. String
The delimited list of email addresses to receive the alert when it triggers. Delimiter characters can be a comma, space, TAB, or semicolon.
state This property is required. String
The current state of the resource to filter by.
threshold This property is required. Double
The threshold for triggering the alert. If the thresholdType is PERCENTAGE, the maximum value is 10000.
thresholdType This property is required. String
The type of threshold.
timeCreated This property is required. String
The time when the budget was created.
timeUpdated This property is required. String
The time when the budget was updated.
type This property is required. String
The type of the alert. Valid values are ACTUAL (the alert triggers based on actual usage), or FORECAST (the alert triggers based on predicted usage).
version This property is required. Integer
The version of the alert rule. Starts from 1 and increments by 1.
budgetId This property is required. string
The unique budget OCID.
definedTags This property is required. {[key: string]: string}
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 This property is required. string
The description of the alert rule.
displayName This property is required. string
A user-friendly name. This does not have to be unique, and it's changeable. Example: My new resource
freeformTags This property is required. {[key: string]: string}
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 This property is required. string
The OCID of the alert rule.
message This property is required. string
The custom message that will be sent when the alert is triggered.
recipients This property is required. string
The delimited list of email addresses to receive the alert when it triggers. Delimiter characters can be a comma, space, TAB, or semicolon.
state This property is required. string
The current state of the resource to filter by.
threshold This property is required. number
The threshold for triggering the alert. If the thresholdType is PERCENTAGE, the maximum value is 10000.
thresholdType This property is required. string
The type of threshold.
timeCreated This property is required. string
The time when the budget was created.
timeUpdated This property is required. string
The time when the budget was updated.
type This property is required. string
The type of the alert. Valid values are ACTUAL (the alert triggers based on actual usage), or FORECAST (the alert triggers based on predicted usage).
version This property is required. number
The version of the alert rule. Starts from 1 and increments by 1.
budget_id This property is required. str
The unique budget OCID.
defined_tags This property is required. Mapping[str, str]
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 This property is required. str
The description of the alert rule.
display_name This property is required. str
A user-friendly name. This does not have to be unique, and it's changeable. Example: My new resource
freeform_tags This property is required. Mapping[str, str]
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 This property is required. str
The OCID of the alert rule.
message This property is required. str
The custom message that will be sent when the alert is triggered.
recipients This property is required. str
The delimited list of email addresses to receive the alert when it triggers. Delimiter characters can be a comma, space, TAB, or semicolon.
state This property is required. str
The current state of the resource to filter by.
threshold This property is required. float
The threshold for triggering the alert. If the thresholdType is PERCENTAGE, the maximum value is 10000.
threshold_type This property is required. str
The type of threshold.
time_created This property is required. str
The time when the budget was created.
time_updated This property is required. str
The time when the budget was updated.
type This property is required. str
The type of the alert. Valid values are ACTUAL (the alert triggers based on actual usage), or FORECAST (the alert triggers based on predicted usage).
version This property is required. int
The version of the alert rule. Starts from 1 and increments by 1.
budgetId This property is required. String
The unique budget OCID.
definedTags This property is required. Map<String>
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 This property is required. String
The description of the alert rule.
displayName This property is required. String
A user-friendly name. This does not have to be unique, and it's changeable. Example: My new resource
freeformTags This property is required. Map<String>
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 This property is required. String
The OCID of the alert rule.
message This property is required. String
The custom message that will be sent when the alert is triggered.
recipients This property is required. String
The delimited list of email addresses to receive the alert when it triggers. Delimiter characters can be a comma, space, TAB, or semicolon.
state This property is required. String
The current state of the resource to filter by.
threshold This property is required. Number
The threshold for triggering the alert. If the thresholdType is PERCENTAGE, the maximum value is 10000.
thresholdType This property is required. String
The type of threshold.
timeCreated This property is required. String
The time when the budget was created.
timeUpdated This property is required. String
The time when the budget was updated.
type This property is required. String
The type of the alert. Valid values are ACTUAL (the alert triggers based on actual usage), or FORECAST (the alert triggers based on predicted usage).
version This property is required. Number
The version of the alert rule. Starts from 1 and increments by 1.

GetAlertRulesFilter

Name This property is required. string
Values This property is required. List<string>
Regex bool
Name This property is required. string
Values This property is required. []string
Regex bool
name This property is required. String
values This property is required. List<String>
regex Boolean
name This property is required. string
values This property is required. string[]
regex boolean
name This property is required. str
values This property is required. Sequence[str]
regex bool
name This property is required. String
values This property is required. List<String>
regex Boolean

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.
Oracle Cloud Infrastructure v2.29.0 published on Wednesday, Apr 9, 2025 by Pulumi