1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Budget
  5. CostAnomalyMonitor
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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testCostAnomalyMonitor = new oci.budget.CostAnomalyMonitor("test_cost_anomaly_monitor", {
        compartmentId: compartmentId,
        name: costAnomalyMonitorName,
        targetResourceFilter: costAnomalyMonitorTargetResourceFilter,
        costAlertSubscriptionMap: {
            costAlertSubscriptionId: testCostAlertSubscription.id,
            operator: costAnomalyMonitorCostAlertSubscriptionMapOperator,
            thresholdAbsoluteValue: costAnomalyMonitorCostAlertSubscriptionMapThresholdAbsoluteValue,
            thresholdRelativePercent: costAnomalyMonitorCostAlertSubscriptionMapThresholdRelativePercent,
        },
        definedTags: {
            "Operations.CostCenter": "42",
        },
        description: costAnomalyMonitorDescription,
        freeformTags: {
            Department: "Finance",
        },
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_cost_anomaly_monitor = oci.budget.CostAnomalyMonitor("test_cost_anomaly_monitor",
        compartment_id=compartment_id,
        name=cost_anomaly_monitor_name,
        target_resource_filter=cost_anomaly_monitor_target_resource_filter,
        cost_alert_subscription_map={
            "cost_alert_subscription_id": test_cost_alert_subscription["id"],
            "operator": cost_anomaly_monitor_cost_alert_subscription_map_operator,
            "threshold_absolute_value": cost_anomaly_monitor_cost_alert_subscription_map_threshold_absolute_value,
            "threshold_relative_percent": cost_anomaly_monitor_cost_alert_subscription_map_threshold_relative_percent,
        },
        defined_tags={
            "Operations.CostCenter": "42",
        },
        description=cost_anomaly_monitor_description,
        freeform_tags={
            "Department": "Finance",
        })
    
    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.NewCostAnomalyMonitor(ctx, "test_cost_anomaly_monitor", &budget.CostAnomalyMonitorArgs{
    			CompartmentId:        pulumi.Any(compartmentId),
    			Name:                 pulumi.Any(costAnomalyMonitorName),
    			TargetResourceFilter: pulumi.Any(costAnomalyMonitorTargetResourceFilter),
    			CostAlertSubscriptionMap: &budget.CostAnomalyMonitorCostAlertSubscriptionMapArgs{
    				CostAlertSubscriptionId:  pulumi.Any(testCostAlertSubscription.Id),
    				Operator:                 pulumi.Any(costAnomalyMonitorCostAlertSubscriptionMapOperator),
    				ThresholdAbsoluteValue:   pulumi.Any(costAnomalyMonitorCostAlertSubscriptionMapThresholdAbsoluteValue),
    				ThresholdRelativePercent: pulumi.Any(costAnomalyMonitorCostAlertSubscriptionMapThresholdRelativePercent),
    			},
    			DefinedTags: pulumi.StringMap{
    				"Operations.CostCenter": pulumi.String("42"),
    			},
    			Description: pulumi.Any(costAnomalyMonitorDescription),
    			FreeformTags: pulumi.StringMap{
    				"Department": pulumi.String("Finance"),
    			},
    		})
    		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 testCostAnomalyMonitor = new Oci.Budget.CostAnomalyMonitor("test_cost_anomaly_monitor", new()
        {
            CompartmentId = compartmentId,
            Name = costAnomalyMonitorName,
            TargetResourceFilter = costAnomalyMonitorTargetResourceFilter,
            CostAlertSubscriptionMap = new Oci.Budget.Inputs.CostAnomalyMonitorCostAlertSubscriptionMapArgs
            {
                CostAlertSubscriptionId = testCostAlertSubscription.Id,
                Operator = costAnomalyMonitorCostAlertSubscriptionMapOperator,
                ThresholdAbsoluteValue = costAnomalyMonitorCostAlertSubscriptionMapThresholdAbsoluteValue,
                ThresholdRelativePercent = costAnomalyMonitorCostAlertSubscriptionMapThresholdRelativePercent,
            },
            DefinedTags = 
            {
                { "Operations.CostCenter", "42" },
            },
            Description = costAnomalyMonitorDescription,
            FreeformTags = 
            {
                { "Department", "Finance" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Budget.CostAnomalyMonitor;
    import com.pulumi.oci.Budget.CostAnomalyMonitorArgs;
    import com.pulumi.oci.Budget.inputs.CostAnomalyMonitorCostAlertSubscriptionMapArgs;
    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) {
            var testCostAnomalyMonitor = new CostAnomalyMonitor("testCostAnomalyMonitor", CostAnomalyMonitorArgs.builder()
                .compartmentId(compartmentId)
                .name(costAnomalyMonitorName)
                .targetResourceFilter(costAnomalyMonitorTargetResourceFilter)
                .costAlertSubscriptionMap(CostAnomalyMonitorCostAlertSubscriptionMapArgs.builder()
                    .costAlertSubscriptionId(testCostAlertSubscription.id())
                    .operator(costAnomalyMonitorCostAlertSubscriptionMapOperator)
                    .thresholdAbsoluteValue(costAnomalyMonitorCostAlertSubscriptionMapThresholdAbsoluteValue)
                    .thresholdRelativePercent(costAnomalyMonitorCostAlertSubscriptionMapThresholdRelativePercent)
                    .build())
                .definedTags(Map.of("Operations.CostCenter", "42"))
                .description(costAnomalyMonitorDescription)
                .freeformTags(Map.of("Department", "Finance"))
                .build());
    
        }
    }
    
    resources:
      testCostAnomalyMonitor:
        type: oci:Budget:CostAnomalyMonitor
        name: test_cost_anomaly_monitor
        properties:
          compartmentId: ${compartmentId}
          name: ${costAnomalyMonitorName}
          targetResourceFilter: ${costAnomalyMonitorTargetResourceFilter}
          costAlertSubscriptionMap:
            costAlertSubscriptionId: ${testCostAlertSubscription.id}
            operator: ${costAnomalyMonitorCostAlertSubscriptionMapOperator}
            thresholdAbsoluteValue: ${costAnomalyMonitorCostAlertSubscriptionMapThresholdAbsoluteValue}
            thresholdRelativePercent: ${costAnomalyMonitorCostAlertSubscriptionMapThresholdRelativePercent}
          definedTags:
            Operations.CostCenter: '42'
          description: ${costAnomalyMonitorDescription}
          freeformTags:
            Department: Finance
    

    Create CostAnomalyMonitor Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new CostAnomalyMonitor(name: string, args: CostAnomalyMonitorArgs, opts?: CustomResourceOptions);
    @overload
    def CostAnomalyMonitor(resource_name: str,
                           args: CostAnomalyMonitorArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def CostAnomalyMonitor(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           compartment_id: Optional[str] = None,
                           target_resource_filter: Optional[str] = None,
                           cost_alert_subscription_map: Optional[CostAnomalyMonitorCostAlertSubscriptionMapArgs] = None,
                           defined_tags: Optional[Mapping[str, str]] = None,
                           description: Optional[str] = None,
                           freeform_tags: Optional[Mapping[str, str]] = None,
                           name: Optional[str] = None)
    func NewCostAnomalyMonitor(ctx *Context, name string, args CostAnomalyMonitorArgs, opts ...ResourceOption) (*CostAnomalyMonitor, error)
    public CostAnomalyMonitor(string name, CostAnomalyMonitorArgs args, CustomResourceOptions? opts = null)
    public CostAnomalyMonitor(String name, CostAnomalyMonitorArgs args)
    public CostAnomalyMonitor(String name, CostAnomalyMonitorArgs args, CustomResourceOptions options)
    
    type: oci:Budget:CostAnomalyMonitor
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args CostAnomalyMonitorArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args CostAnomalyMonitorArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args CostAnomalyMonitorArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CostAnomalyMonitorArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CostAnomalyMonitorArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var costAnomalyMonitorResource = new Oci.Budget.CostAnomalyMonitor("costAnomalyMonitorResource", new()
    {
        CompartmentId = "string",
        TargetResourceFilter = "string",
        CostAlertSubscriptionMap = new Oci.Budget.Inputs.CostAnomalyMonitorCostAlertSubscriptionMapArgs
        {
            CostAlertSubscriptionId = "string",
            Operator = "string",
            ThresholdAbsoluteValue = 0,
            ThresholdRelativePercent = 0,
        },
        DefinedTags = 
        {
            { "string", "string" },
        },
        Description = "string",
        FreeformTags = 
        {
            { "string", "string" },
        },
        Name = "string",
    });
    
    example, err := budget.NewCostAnomalyMonitor(ctx, "costAnomalyMonitorResource", &budget.CostAnomalyMonitorArgs{
    	CompartmentId:        pulumi.String("string"),
    	TargetResourceFilter: pulumi.String("string"),
    	CostAlertSubscriptionMap: &budget.CostAnomalyMonitorCostAlertSubscriptionMapArgs{
    		CostAlertSubscriptionId:  pulumi.String("string"),
    		Operator:                 pulumi.String("string"),
    		ThresholdAbsoluteValue:   pulumi.Int(0),
    		ThresholdRelativePercent: pulumi.Int(0),
    	},
    	DefinedTags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Description: pulumi.String("string"),
    	FreeformTags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Name: pulumi.String("string"),
    })
    
    var costAnomalyMonitorResource = new CostAnomalyMonitor("costAnomalyMonitorResource", CostAnomalyMonitorArgs.builder()
        .compartmentId("string")
        .targetResourceFilter("string")
        .costAlertSubscriptionMap(CostAnomalyMonitorCostAlertSubscriptionMapArgs.builder()
            .costAlertSubscriptionId("string")
            .operator("string")
            .thresholdAbsoluteValue(0)
            .thresholdRelativePercent(0)
            .build())
        .definedTags(Map.of("string", "string"))
        .description("string")
        .freeformTags(Map.of("string", "string"))
        .name("string")
        .build());
    
    cost_anomaly_monitor_resource = oci.budget.CostAnomalyMonitor("costAnomalyMonitorResource",
        compartment_id="string",
        target_resource_filter="string",
        cost_alert_subscription_map={
            "cost_alert_subscription_id": "string",
            "operator": "string",
            "threshold_absolute_value": 0,
            "threshold_relative_percent": 0,
        },
        defined_tags={
            "string": "string",
        },
        description="string",
        freeform_tags={
            "string": "string",
        },
        name="string")
    
    const costAnomalyMonitorResource = new oci.budget.CostAnomalyMonitor("costAnomalyMonitorResource", {
        compartmentId: "string",
        targetResourceFilter: "string",
        costAlertSubscriptionMap: {
            costAlertSubscriptionId: "string",
            operator: "string",
            thresholdAbsoluteValue: 0,
            thresholdRelativePercent: 0,
        },
        definedTags: {
            string: "string",
        },
        description: "string",
        freeformTags: {
            string: "string",
        },
        name: "string",
    });
    
    type: oci:Budget:CostAnomalyMonitor
    properties:
        compartmentId: string
        costAlertSubscriptionMap:
            costAlertSubscriptionId: string
            operator: string
            thresholdAbsoluteValue: 0
            thresholdRelativePercent: 0
        definedTags:
            string: string
        description: string
        freeformTags:
            string: string
        name: string
        targetResourceFilter: string
    

    CostAnomalyMonitor Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The CostAnomalyMonitor resource accepts the following input properties:

    CompartmentId string
    The OCID of the compartment.
    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.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    CostAlertSubscriptionMap CostAnomalyMonitorCostAlertSubscriptionMap
    (Updatable) The mapping of cost monitor to alert subscription along with thresholds.
    DefinedTags Dictionary<string, string>
    (Updatable) 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
    (Updatable) The description of the cost anomaly monitor.
    FreeformTags Dictionary<string, string>
    (Updatable) 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"}
    Name string
    The name of the cost anomaly monitor. Avoid entering confidential information.
    CompartmentId string
    The OCID of the compartment.
    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.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    CostAlertSubscriptionMap CostAnomalyMonitorCostAlertSubscriptionMapArgs
    (Updatable) The mapping of cost monitor to alert subscription along with thresholds.
    DefinedTags map[string]string
    (Updatable) 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
    (Updatable) The description of the cost anomaly monitor.
    FreeformTags map[string]string
    (Updatable) 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"}
    Name string
    The name of the cost anomaly monitor. Avoid entering confidential information.
    compartmentId String
    The OCID of the compartment.
    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.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    costAlertSubscriptionMap CostAnomalyMonitorCostAlertSubscriptionMap
    (Updatable) The mapping of cost monitor to alert subscription along with thresholds.
    definedTags Map<String,String>
    (Updatable) 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
    (Updatable) The description of the cost anomaly monitor.
    freeformTags Map<String,String>
    (Updatable) 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"}
    name String
    The name of the cost anomaly monitor. Avoid entering confidential information.
    compartmentId string
    The OCID of the compartment.
    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.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    costAlertSubscriptionMap CostAnomalyMonitorCostAlertSubscriptionMap
    (Updatable) The mapping of cost monitor to alert subscription along with thresholds.
    definedTags {[key: string]: string}
    (Updatable) 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
    (Updatable) The description of the cost anomaly monitor.
    freeformTags {[key: string]: string}
    (Updatable) 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"}
    name string
    The name of the cost anomaly monitor. Avoid entering confidential information.
    compartment_id str
    The OCID of the compartment.
    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.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    cost_alert_subscription_map CostAnomalyMonitorCostAlertSubscriptionMapArgs
    (Updatable) The mapping of cost monitor to alert subscription along with thresholds.
    defined_tags Mapping[str, str]
    (Updatable) 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
    (Updatable) The description of the cost anomaly monitor.
    freeform_tags Mapping[str, str]
    (Updatable) 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"}
    name str
    The name of the cost anomaly monitor. Avoid entering confidential information.
    compartmentId String
    The OCID of the compartment.
    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.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    costAlertSubscriptionMap Property Map
    (Updatable) The mapping of cost monitor to alert subscription along with thresholds.
    definedTags Map<String>
    (Updatable) 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
    (Updatable) The description of the cost anomaly monitor.
    freeformTags Map<String>
    (Updatable) 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"}
    name String
    The name of the cost anomaly monitor. Avoid entering confidential information.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the CostAnomalyMonitor resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    LifecycleDetails string
    The current state details of the cost monitor.
    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"}
    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
    Id string
    The provider-assigned unique ID for this managed resource.
    LifecycleDetails string
    The current state details of the cost monitor.
    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"}
    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
    id String
    The provider-assigned unique ID for this managed resource.
    lifecycleDetails String
    The current state details of the cost monitor.
    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"}
    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
    id string
    The provider-assigned unique ID for this managed resource.
    lifecycleDetails string
    The current state details of the cost monitor.
    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"}
    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
    id str
    The provider-assigned unique ID for this managed resource.
    lifecycle_details str
    The current state details of the cost monitor.
    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"}
    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
    id String
    The provider-assigned unique ID for this managed resource.
    lifecycleDetails String
    The current state details of the cost monitor.
    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"}
    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

    Look up Existing CostAnomalyMonitor Resource

    Get an existing CostAnomalyMonitor resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: CostAnomalyMonitorState, opts?: CustomResourceOptions): CostAnomalyMonitor
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            compartment_id: Optional[str] = None,
            cost_alert_subscription_map: Optional[CostAnomalyMonitorCostAlertSubscriptionMapArgs] = None,
            defined_tags: Optional[Mapping[str, str]] = None,
            description: Optional[str] = None,
            freeform_tags: Optional[Mapping[str, str]] = None,
            lifecycle_details: Optional[str] = None,
            name: Optional[str] = None,
            state: Optional[str] = None,
            system_tags: Optional[Mapping[str, str]] = None,
            target_resource_filter: Optional[str] = None,
            time_created: Optional[str] = None,
            time_updated: Optional[str] = None,
            type: Optional[str] = None) -> CostAnomalyMonitor
    func GetCostAnomalyMonitor(ctx *Context, name string, id IDInput, state *CostAnomalyMonitorState, opts ...ResourceOption) (*CostAnomalyMonitor, error)
    public static CostAnomalyMonitor Get(string name, Input<string> id, CostAnomalyMonitorState? state, CustomResourceOptions? opts = null)
    public static CostAnomalyMonitor get(String name, Output<String> id, CostAnomalyMonitorState state, CustomResourceOptions options)
    resources:  _:    type: oci:Budget:CostAnomalyMonitor    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    CompartmentId string
    The OCID of the compartment.
    CostAlertSubscriptionMap CostAnomalyMonitorCostAlertSubscriptionMap
    (Updatable) The mapping of cost monitor to alert subscription along with thresholds.
    DefinedTags Dictionary<string, string>
    (Updatable) 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
    (Updatable) The description of the cost anomaly monitor.
    FreeformTags Dictionary<string, string>
    (Updatable) 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"}
    LifecycleDetails string
    The current state details of the cost monitor.
    Name string
    The name of the cost anomaly monitor. Avoid entering confidential information.
    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.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    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 OCID of the compartment.
    CostAlertSubscriptionMap CostAnomalyMonitorCostAlertSubscriptionMapArgs
    (Updatable) The mapping of cost monitor to alert subscription along with thresholds.
    DefinedTags map[string]string
    (Updatable) 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
    (Updatable) The description of the cost anomaly monitor.
    FreeformTags map[string]string
    (Updatable) 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"}
    LifecycleDetails string
    The current state details of the cost monitor.
    Name string
    The name of the cost anomaly monitor. Avoid entering confidential information.
    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.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    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 OCID of the compartment.
    costAlertSubscriptionMap CostAnomalyMonitorCostAlertSubscriptionMap
    (Updatable) The mapping of cost monitor to alert subscription along with thresholds.
    definedTags Map<String,String>
    (Updatable) 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
    (Updatable) The description of the cost anomaly monitor.
    freeformTags Map<String,String>
    (Updatable) 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"}
    lifecycleDetails String
    The current state details of the cost monitor.
    name String
    The name of the cost anomaly monitor. Avoid entering confidential information.
    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.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    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 OCID of the compartment.
    costAlertSubscriptionMap CostAnomalyMonitorCostAlertSubscriptionMap
    (Updatable) The mapping of cost monitor to alert subscription along with thresholds.
    definedTags {[key: string]: string}
    (Updatable) 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
    (Updatable) The description of the cost anomaly monitor.
    freeformTags {[key: string]: string}
    (Updatable) 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"}
    lifecycleDetails string
    The current state details of the cost monitor.
    name string
    The name of the cost anomaly monitor. Avoid entering confidential information.
    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.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    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 OCID of the compartment.
    cost_alert_subscription_map CostAnomalyMonitorCostAlertSubscriptionMapArgs
    (Updatable) The mapping of cost monitor to alert subscription along with thresholds.
    defined_tags Mapping[str, str]
    (Updatable) 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
    (Updatable) The description of the cost anomaly monitor.
    freeform_tags Mapping[str, str]
    (Updatable) 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"}
    lifecycle_details str
    The current state details of the cost monitor.
    name str
    The name of the cost anomaly monitor. Avoid entering confidential information.
    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.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    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 OCID of the compartment.
    costAlertSubscriptionMap Property Map
    (Updatable) The mapping of cost monitor to alert subscription along with thresholds.
    definedTags Map<String>
    (Updatable) 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
    (Updatable) The description of the cost anomaly monitor.
    freeformTags Map<String>
    (Updatable) 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"}
    lifecycleDetails String
    The current state details of the cost monitor.
    name String
    The name of the cost anomaly monitor. Avoid entering confidential information.
    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.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    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

    Supporting Types

    CostAnomalyMonitorCostAlertSubscriptionMap, CostAnomalyMonitorCostAlertSubscriptionMapArgs

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

    Import

    CostAnomalyMonitors can be imported using the id, e.g.

    $ pulumi import oci:Budget/costAnomalyMonitor:CostAnomalyMonitor test_cost_anomaly_monitor "id"
    

    To learn more about importing existing cloud resources, see Importing resources.

    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