1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Budget
  5. getCostAnomalyMonitors
Oracle Cloud Infrastructure v3.16.0 published on Wednesday, Jan 28, 2026 by Pulumi
oci logo
Oracle Cloud Infrastructure v3.16.0 published on Wednesday, Jan 28, 2026 by Pulumi

    This data source provides the list of Cost Anomaly Monitors in Oracle Cloud Infrastructure Budget service.

    Gets a list of Cost Anomaly Monitors in a compartment.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testCostAnomalyMonitors = oci.Budget.getCostAnomalyMonitors({
        compartmentId: compartmentId,
        name: costAnomalyMonitorName,
        regions: costAnomalyMonitorRegion,
        state: costAnomalyMonitorState,
        targetTenantIds: testTargetTenant.id,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_cost_anomaly_monitors = oci.Budget.get_cost_anomaly_monitors(compartment_id=compartment_id,
        name=cost_anomaly_monitor_name,
        regions=cost_anomaly_monitor_region,
        state=cost_anomaly_monitor_state,
        target_tenant_ids=test_target_tenant["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v3/go/oci/budget"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := budget.GetCostAnomalyMonitors(ctx, &budget.GetCostAnomalyMonitorsArgs{
    			CompartmentId:   compartmentId,
    			Name:            pulumi.StringRef(costAnomalyMonitorName),
    			Regions:         costAnomalyMonitorRegion,
    			State:           pulumi.StringRef(costAnomalyMonitorState),
    			TargetTenantIds: testTargetTenant.Id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testCostAnomalyMonitors = Oci.Budget.GetCostAnomalyMonitors.Invoke(new()
        {
            CompartmentId = compartmentId,
            Name = costAnomalyMonitorName,
            Regions = costAnomalyMonitorRegion,
            State = costAnomalyMonitorState,
            TargetTenantIds = testTargetTenant.Id,
        });
    
    });
    
    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.GetCostAnomalyMonitorsArgs;
    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 testCostAnomalyMonitors = BudgetFunctions.getCostAnomalyMonitors(GetCostAnomalyMonitorsArgs.builder()
                .compartmentId(compartmentId)
                .name(costAnomalyMonitorName)
                .regions(costAnomalyMonitorRegion)
                .state(costAnomalyMonitorState)
                .targetTenantIds(testTargetTenant.id())
                .build());
    
        }
    }
    
    variables:
      testCostAnomalyMonitors:
        fn::invoke:
          function: oci:Budget:getCostAnomalyMonitors
          arguments:
            compartmentId: ${compartmentId}
            name: ${costAnomalyMonitorName}
            regions: ${costAnomalyMonitorRegion}
            state: ${costAnomalyMonitorState}
            targetTenantIds: ${testTargetTenant.id}
    

    Using getCostAnomalyMonitors

    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 getCostAnomalyMonitors(args: GetCostAnomalyMonitorsArgs, opts?: InvokeOptions): Promise<GetCostAnomalyMonitorsResult>
    function getCostAnomalyMonitorsOutput(args: GetCostAnomalyMonitorsOutputArgs, opts?: InvokeOptions): Output<GetCostAnomalyMonitorsResult>
    def get_cost_anomaly_monitors(compartment_id: Optional[str] = None,
                                  filters: Optional[Sequence[GetCostAnomalyMonitorsFilter]] = None,
                                  name: Optional[str] = None,
                                  regions: Optional[Sequence[str]] = None,
                                  state: Optional[str] = None,
                                  target_tenant_ids: Optional[Sequence[str]] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetCostAnomalyMonitorsResult
    def get_cost_anomaly_monitors_output(compartment_id: Optional[pulumi.Input[str]] = None,
                                  filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetCostAnomalyMonitorsFilterArgs]]]] = None,
                                  name: Optional[pulumi.Input[str]] = None,
                                  regions: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                  state: Optional[pulumi.Input[str]] = None,
                                  target_tenant_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[GetCostAnomalyMonitorsResult]
    func GetCostAnomalyMonitors(ctx *Context, args *GetCostAnomalyMonitorsArgs, opts ...InvokeOption) (*GetCostAnomalyMonitorsResult, error)
    func GetCostAnomalyMonitorsOutput(ctx *Context, args *GetCostAnomalyMonitorsOutputArgs, opts ...InvokeOption) GetCostAnomalyMonitorsResultOutput

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

    public static class GetCostAnomalyMonitors 
    {
        public static Task<GetCostAnomalyMonitorsResult> InvokeAsync(GetCostAnomalyMonitorsArgs args, InvokeOptions? opts = null)
        public static Output<GetCostAnomalyMonitorsResult> Invoke(GetCostAnomalyMonitorsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCostAnomalyMonitorsResult> getCostAnomalyMonitors(GetCostAnomalyMonitorsArgs args, InvokeOptions options)
    public static Output<GetCostAnomalyMonitorsResult> getCostAnomalyMonitors(GetCostAnomalyMonitorsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: oci:Budget/getCostAnomalyMonitors:getCostAnomalyMonitors
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CompartmentId string
    The ID of the compartment in which to list resources.
    Filters List<GetCostAnomalyMonitorsFilter>
    Name string
    Unique, non-changeable resource name.
    Regions List<string>
    Cost Anomaly Monitor target resource filter region.
    State string
    The current state of the cost monitor.
    TargetTenantIds List<string>
    The target tenantId ocid filter param.
    CompartmentId string
    The ID of the compartment in which to list resources.
    Filters []GetCostAnomalyMonitorsFilter
    Name string
    Unique, non-changeable resource name.
    Regions []string
    Cost Anomaly Monitor target resource filter region.
    State string
    The current state of the cost monitor.
    TargetTenantIds []string
    The target tenantId ocid filter param.
    compartmentId String
    The ID of the compartment in which to list resources.
    filters List<GetCostAnomalyMonitorsFilter>
    name String
    Unique, non-changeable resource name.
    regions List<String>
    Cost Anomaly Monitor target resource filter region.
    state String
    The current state of the cost monitor.
    targetTenantIds List<String>
    The target tenantId ocid filter param.
    compartmentId string
    The ID of the compartment in which to list resources.
    filters GetCostAnomalyMonitorsFilter[]
    name string
    Unique, non-changeable resource name.
    regions string[]
    Cost Anomaly Monitor target resource filter region.
    state string
    The current state of the cost monitor.
    targetTenantIds string[]
    The target tenantId ocid filter param.
    compartment_id str
    The ID of the compartment in which to list resources.
    filters Sequence[GetCostAnomalyMonitorsFilter]
    name str
    Unique, non-changeable resource name.
    regions Sequence[str]
    Cost Anomaly Monitor target resource filter region.
    state str
    The current state of the cost monitor.
    target_tenant_ids Sequence[str]
    The target tenantId ocid filter param.
    compartmentId String
    The ID of the compartment in which to list resources.
    filters List<Property Map>
    name String
    Unique, non-changeable resource name.
    regions List<String>
    Cost Anomaly Monitor target resource filter region.
    state String
    The current state of the cost monitor.
    targetTenantIds List<String>
    The target tenantId ocid filter param.

    getCostAnomalyMonitors Result

    The following output properties are available:

    CompartmentId string
    The OCID of the compartment.
    CostAnomalyMonitorCollections List<GetCostAnomalyMonitorsCostAnomalyMonitorCollection>
    The list of cost_anomaly_monitor_collection.
    Id string
    The provider-assigned unique ID for this managed resource.
    Filters List<GetCostAnomalyMonitorsFilter>
    Name string
    The name of the cost anomaly monitor. Avoid entering confidential information.
    Regions List<string>
    State string
    The current state of the cost monitor.
    TargetTenantIds List<string>
    CompartmentId string
    The OCID of the compartment.
    CostAnomalyMonitorCollections []GetCostAnomalyMonitorsCostAnomalyMonitorCollection
    The list of cost_anomaly_monitor_collection.
    Id string
    The provider-assigned unique ID for this managed resource.
    Filters []GetCostAnomalyMonitorsFilter
    Name string
    The name of the cost anomaly monitor. Avoid entering confidential information.
    Regions []string
    State string
    The current state of the cost monitor.
    TargetTenantIds []string
    compartmentId String
    The OCID of the compartment.
    costAnomalyMonitorCollections List<GetCostAnomalyMonitorsCostAnomalyMonitorCollection>
    The list of cost_anomaly_monitor_collection.
    id String
    The provider-assigned unique ID for this managed resource.
    filters List<GetCostAnomalyMonitorsFilter>
    name String
    The name of the cost anomaly monitor. Avoid entering confidential information.
    regions List<String>
    state String
    The current state of the cost monitor.
    targetTenantIds List<String>
    compartmentId string
    The OCID of the compartment.
    costAnomalyMonitorCollections GetCostAnomalyMonitorsCostAnomalyMonitorCollection[]
    The list of cost_anomaly_monitor_collection.
    id string
    The provider-assigned unique ID for this managed resource.
    filters GetCostAnomalyMonitorsFilter[]
    name string
    The name of the cost anomaly monitor. Avoid entering confidential information.
    regions string[]
    state string
    The current state of the cost monitor.
    targetTenantIds string[]
    compartment_id str
    The OCID of the compartment.
    cost_anomaly_monitor_collections Sequence[GetCostAnomalyMonitorsCostAnomalyMonitorCollection]
    The list of cost_anomaly_monitor_collection.
    id str
    The provider-assigned unique ID for this managed resource.
    filters Sequence[GetCostAnomalyMonitorsFilter]
    name str
    The name of the cost anomaly monitor. Avoid entering confidential information.
    regions Sequence[str]
    state str
    The current state of the cost monitor.
    target_tenant_ids Sequence[str]
    compartmentId String
    The OCID of the compartment.
    costAnomalyMonitorCollections List<Property Map>
    The list of cost_anomaly_monitor_collection.
    id String
    The provider-assigned unique ID for this managed resource.
    filters List<Property Map>
    name String
    The name of the cost anomaly monitor. Avoid entering confidential information.
    regions List<String>
    state String
    The current state of the cost monitor.
    targetTenantIds List<String>

    Supporting Types

    GetCostAnomalyMonitorsCostAnomalyMonitorCollection

    GetCostAnomalyMonitorsCostAnomalyMonitorCollectionItem

    CompartmentId string
    The ID of the compartment in which to list resources.
    CostAlertSubscriptionMaps List<GetCostAnomalyMonitorsCostAnomalyMonitorCollectionItemCostAlertSubscriptionMap>
    The mapping of cost monitor to alert subscription along with thresholds.
    DefinedTags 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 string
    The description of the budget.
    FreeformTags 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 string
    The OCID of the Cost Anomaly Monitor.
    LifecycleDetails string
    The current state details of the cost monitor.
    Name string
    Unique, non-changeable resource name.
    State string
    The current state of the cost monitor.
    SystemTags Dictionary<string, string>
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
    TargetResourceFilter string
    The filter object to target resources for cost monitor. Cost generated by one or more resources identified by this filter is monitored for anomalous deviations.
    TimeCreated string
    The time that the cost monitor was created.
    TimeUpdated string
    The time that the cost monitor was last updated.
    Type string
    Type of cost monitor
    CompartmentId string
    The ID of the compartment in which to list resources.
    CostAlertSubscriptionMaps []GetCostAnomalyMonitorsCostAnomalyMonitorCollectionItemCostAlertSubscriptionMap
    The mapping of cost monitor to alert subscription along with thresholds.
    DefinedTags 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 string
    The description of the budget.
    FreeformTags 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 string
    The OCID of the Cost Anomaly Monitor.
    LifecycleDetails string
    The current state details of the cost monitor.
    Name string
    Unique, non-changeable resource name.
    State string
    The current state of the cost monitor.
    SystemTags map[string]string
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
    TargetResourceFilter string
    The filter object to target resources for cost monitor. Cost generated by one or more resources identified by this filter is monitored for anomalous deviations.
    TimeCreated string
    The time that the cost monitor was created.
    TimeUpdated string
    The time that the cost monitor was last updated.
    Type string
    Type of cost monitor
    compartmentId String
    The ID of the compartment in which to list resources.
    costAlertSubscriptionMaps List<GetCostAnomalyMonitorsCostAnomalyMonitorCollectionItemCostAlertSubscriptionMap>
    The mapping of cost monitor to alert subscription along with thresholds.
    definedTags 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 String
    The description of the budget.
    freeformTags 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 String
    The OCID of the Cost Anomaly Monitor.
    lifecycleDetails String
    The current state details of the cost monitor.
    name String
    Unique, non-changeable resource name.
    state String
    The current state of the cost monitor.
    systemTags Map<String,String>
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
    targetResourceFilter String
    The filter object to target resources for cost monitor. Cost generated by one or more resources identified by this filter is monitored for anomalous deviations.
    timeCreated String
    The time that the cost monitor was created.
    timeUpdated String
    The time that the cost monitor was last updated.
    type String
    Type of cost monitor
    compartmentId string
    The ID of the compartment in which to list resources.
    costAlertSubscriptionMaps GetCostAnomalyMonitorsCostAnomalyMonitorCollectionItemCostAlertSubscriptionMap[]
    The mapping of cost monitor to alert subscription along with thresholds.
    definedTags {[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 string
    The description of the budget.
    freeformTags {[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 string
    The OCID of the Cost Anomaly Monitor.
    lifecycleDetails string
    The current state details of the cost monitor.
    name string
    Unique, non-changeable resource name.
    state string
    The current state of the cost monitor.
    systemTags {[key: string]: string}
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
    targetResourceFilter string
    The filter object to target resources for cost monitor. Cost generated by one or more resources identified by this filter is monitored for anomalous deviations.
    timeCreated string
    The time that the cost monitor was created.
    timeUpdated string
    The time that the cost monitor was last updated.
    type string
    Type of cost monitor
    compartment_id str
    The ID of the compartment in which to list resources.
    cost_alert_subscription_maps Sequence[GetCostAnomalyMonitorsCostAnomalyMonitorCollectionItemCostAlertSubscriptionMap]
    The mapping of cost monitor to alert subscription along with thresholds.
    defined_tags 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 str
    The description of the budget.
    freeform_tags 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 str
    The OCID of the Cost Anomaly Monitor.
    lifecycle_details str
    The current state details of the cost monitor.
    name str
    Unique, non-changeable resource name.
    state str
    The current state of the cost monitor.
    system_tags Mapping[str, str]
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
    target_resource_filter str
    The filter object to target resources for cost monitor. Cost generated by one or more resources identified by this filter is monitored for anomalous deviations.
    time_created str
    The time that the cost monitor was created.
    time_updated str
    The time that the cost monitor was last updated.
    type str
    Type of cost monitor
    compartmentId String
    The ID of the compartment in which to list resources.
    costAlertSubscriptionMaps List<Property Map>
    The mapping of cost monitor to alert subscription along with thresholds.
    definedTags 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 String
    The description of the budget.
    freeformTags 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 String
    The OCID of the Cost Anomaly Monitor.
    lifecycleDetails String
    The current state details of the cost monitor.
    name String
    Unique, non-changeable resource name.
    state String
    The current state of the cost monitor.
    systemTags Map<String>
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
    targetResourceFilter String
    The filter object to target resources for cost monitor. Cost generated by one or more resources identified by this filter is monitored for anomalous deviations.
    timeCreated String
    The time that the cost monitor was created.
    timeUpdated String
    The time that the cost monitor was last updated.
    type String
    Type of cost monitor

    GetCostAnomalyMonitorsCostAnomalyMonitorCollectionItemCostAlertSubscriptionMap

    CostAlertSubscriptionId string
    The costAlertSubscription ocid which the cost monitor alert maps to.
    Operator string
    The filter operator. Example: 'AND', 'OR'.
    ThresholdAbsoluteValue int
    The absolute threshold value.
    ThresholdRelativePercent int
    The relative percentage threshold value.
    CostAlertSubscriptionId string
    The costAlertSubscription ocid which the cost monitor alert maps to.
    Operator string
    The filter operator. Example: 'AND', 'OR'.
    ThresholdAbsoluteValue int
    The absolute threshold value.
    ThresholdRelativePercent int
    The relative percentage threshold value.
    costAlertSubscriptionId String
    The costAlertSubscription ocid which the cost monitor alert maps to.
    operator String
    The filter operator. Example: 'AND', 'OR'.
    thresholdAbsoluteValue Integer
    The absolute threshold value.
    thresholdRelativePercent Integer
    The relative percentage threshold value.
    costAlertSubscriptionId string
    The costAlertSubscription ocid which the cost monitor alert maps to.
    operator string
    The filter operator. Example: 'AND', 'OR'.
    thresholdAbsoluteValue number
    The absolute threshold value.
    thresholdRelativePercent number
    The relative percentage threshold value.
    cost_alert_subscription_id str
    The costAlertSubscription ocid which the cost monitor alert maps to.
    operator str
    The filter operator. Example: 'AND', 'OR'.
    threshold_absolute_value int
    The absolute threshold value.
    threshold_relative_percent int
    The relative percentage threshold value.
    costAlertSubscriptionId String
    The costAlertSubscription ocid which the cost monitor alert maps to.
    operator String
    The filter operator. Example: 'AND', 'OR'.
    thresholdAbsoluteValue Number
    The absolute threshold value.
    thresholdRelativePercent Number
    The relative percentage threshold value.

    GetCostAnomalyMonitorsFilter

    Name string
    Unique, non-changeable resource name.
    Values List<string>
    Regex bool
    Name string
    Unique, non-changeable resource name.
    Values []string
    Regex bool
    name String
    Unique, non-changeable resource name.
    values List<String>
    regex Boolean
    name string
    Unique, non-changeable resource name.
    values string[]
    regex boolean
    name str
    Unique, non-changeable resource name.
    values Sequence[str]
    regex bool
    name String
    Unique, non-changeable resource name.
    values 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.
    oci logo
    Oracle Cloud Infrastructure v3.16.0 published on Wednesday, Jan 28, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate