1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. arms
  5. PrometheusAlertRule
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

alicloud.arms.PrometheusAlertRule

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

    Provides a Application Real-Time Monitoring Service (ARMS) Prometheus Alert Rule resource.

    For information about Application Real-Time Monitoring Service (ARMS) Prometheus Alert Rule and how to use it, see What is Prometheus Alert Rule.

    NOTE: Available since v1.136.0.

    Create PrometheusAlertRule Resource

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

    Constructor syntax

    new PrometheusAlertRule(name: string, args: PrometheusAlertRuleArgs, opts?: CustomResourceOptions);
    @overload
    def PrometheusAlertRule(resource_name: str,
                            args: PrometheusAlertRuleArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def PrometheusAlertRule(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            cluster_id: Optional[str] = None,
                            duration: Optional[str] = None,
                            expression: Optional[str] = None,
                            message: Optional[str] = None,
                            prometheus_alert_rule_name: Optional[str] = None,
                            annotations: Optional[Sequence[PrometheusAlertRuleAnnotationArgs]] = None,
                            dispatch_rule_id: Optional[str] = None,
                            labels: Optional[Sequence[PrometheusAlertRuleLabelArgs]] = None,
                            notify_type: Optional[str] = None,
                            type: Optional[str] = None)
    func NewPrometheusAlertRule(ctx *Context, name string, args PrometheusAlertRuleArgs, opts ...ResourceOption) (*PrometheusAlertRule, error)
    public PrometheusAlertRule(string name, PrometheusAlertRuleArgs args, CustomResourceOptions? opts = null)
    public PrometheusAlertRule(String name, PrometheusAlertRuleArgs args)
    public PrometheusAlertRule(String name, PrometheusAlertRuleArgs args, CustomResourceOptions options)
    
    type: alicloud:arms:PrometheusAlertRule
    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 PrometheusAlertRuleArgs
    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 PrometheusAlertRuleArgs
    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 PrometheusAlertRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PrometheusAlertRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PrometheusAlertRuleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

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

    var prometheusAlertRuleResource = new AliCloud.Arms.PrometheusAlertRule("prometheusAlertRuleResource", new()
    {
        ClusterId = "string",
        Duration = "string",
        Expression = "string",
        Message = "string",
        PrometheusAlertRuleName = "string",
        Annotations = new[]
        {
            new AliCloud.Arms.Inputs.PrometheusAlertRuleAnnotationArgs
            {
                Name = "string",
                Value = "string",
            },
        },
        DispatchRuleId = "string",
        Labels = new[]
        {
            new AliCloud.Arms.Inputs.PrometheusAlertRuleLabelArgs
            {
                Name = "string",
                Value = "string",
            },
        },
        NotifyType = "string",
        Type = "string",
    });
    
    example, err := arms.NewPrometheusAlertRule(ctx, "prometheusAlertRuleResource", &arms.PrometheusAlertRuleArgs{
    	ClusterId:               pulumi.String("string"),
    	Duration:                pulumi.String("string"),
    	Expression:              pulumi.String("string"),
    	Message:                 pulumi.String("string"),
    	PrometheusAlertRuleName: pulumi.String("string"),
    	Annotations: arms.PrometheusAlertRuleAnnotationArray{
    		&arms.PrometheusAlertRuleAnnotationArgs{
    			Name:  pulumi.String("string"),
    			Value: pulumi.String("string"),
    		},
    	},
    	DispatchRuleId: pulumi.String("string"),
    	Labels: arms.PrometheusAlertRuleLabelArray{
    		&arms.PrometheusAlertRuleLabelArgs{
    			Name:  pulumi.String("string"),
    			Value: pulumi.String("string"),
    		},
    	},
    	NotifyType: pulumi.String("string"),
    	Type:       pulumi.String("string"),
    })
    
    var prometheusAlertRuleResource = new PrometheusAlertRule("prometheusAlertRuleResource", PrometheusAlertRuleArgs.builder()        
        .clusterId("string")
        .duration("string")
        .expression("string")
        .message("string")
        .prometheusAlertRuleName("string")
        .annotations(PrometheusAlertRuleAnnotationArgs.builder()
            .name("string")
            .value("string")
            .build())
        .dispatchRuleId("string")
        .labels(PrometheusAlertRuleLabelArgs.builder()
            .name("string")
            .value("string")
            .build())
        .notifyType("string")
        .type("string")
        .build());
    
    prometheus_alert_rule_resource = alicloud.arms.PrometheusAlertRule("prometheusAlertRuleResource",
        cluster_id="string",
        duration="string",
        expression="string",
        message="string",
        prometheus_alert_rule_name="string",
        annotations=[alicloud.arms.PrometheusAlertRuleAnnotationArgs(
            name="string",
            value="string",
        )],
        dispatch_rule_id="string",
        labels=[alicloud.arms.PrometheusAlertRuleLabelArgs(
            name="string",
            value="string",
        )],
        notify_type="string",
        type="string")
    
    const prometheusAlertRuleResource = new alicloud.arms.PrometheusAlertRule("prometheusAlertRuleResource", {
        clusterId: "string",
        duration: "string",
        expression: "string",
        message: "string",
        prometheusAlertRuleName: "string",
        annotations: [{
            name: "string",
            value: "string",
        }],
        dispatchRuleId: "string",
        labels: [{
            name: "string",
            value: "string",
        }],
        notifyType: "string",
        type: "string",
    });
    
    type: alicloud:arms:PrometheusAlertRule
    properties:
        annotations:
            - name: string
              value: string
        clusterId: string
        dispatchRuleId: string
        duration: string
        expression: string
        labels:
            - name: string
              value: string
        message: string
        notifyType: string
        prometheusAlertRuleName: string
        type: string
    

    PrometheusAlertRule Resource Properties

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

    Inputs

    The PrometheusAlertRule resource accepts the following input properties:

    ClusterId string
    The ID of the cluster.
    Duration string
    The duration of the alert.
    Expression string
    The alert rule expression that follows the PromQL syntax.
    Message string
    The message of the alert notification.
    PrometheusAlertRuleName string
    The name of the resource.
    Annotations List<Pulumi.AliCloud.Arms.Inputs.PrometheusAlertRuleAnnotation>
    The annotations of the alert rule. See annotations below.
    DispatchRuleId string
    The ID of the notification policy. This parameter is required when the notify_type parameter is set to DISPATCH_RULE.
    Labels List<Pulumi.AliCloud.Arms.Inputs.PrometheusAlertRuleLabel>
    The labels of the resource. See labels below.
    NotifyType string
    The method of sending the alert notification. Valid values: ALERT_MANAGER, DISPATCH_RULE.
    Type string
    The type of the alert rule.
    ClusterId string
    The ID of the cluster.
    Duration string
    The duration of the alert.
    Expression string
    The alert rule expression that follows the PromQL syntax.
    Message string
    The message of the alert notification.
    PrometheusAlertRuleName string
    The name of the resource.
    Annotations []PrometheusAlertRuleAnnotationArgs
    The annotations of the alert rule. See annotations below.
    DispatchRuleId string
    The ID of the notification policy. This parameter is required when the notify_type parameter is set to DISPATCH_RULE.
    Labels []PrometheusAlertRuleLabelArgs
    The labels of the resource. See labels below.
    NotifyType string
    The method of sending the alert notification. Valid values: ALERT_MANAGER, DISPATCH_RULE.
    Type string
    The type of the alert rule.
    clusterId String
    The ID of the cluster.
    duration String
    The duration of the alert.
    expression String
    The alert rule expression that follows the PromQL syntax.
    message String
    The message of the alert notification.
    prometheusAlertRuleName String
    The name of the resource.
    annotations List<PrometheusAlertRuleAnnotation>
    The annotations of the alert rule. See annotations below.
    dispatchRuleId String
    The ID of the notification policy. This parameter is required when the notify_type parameter is set to DISPATCH_RULE.
    labels List<PrometheusAlertRuleLabel>
    The labels of the resource. See labels below.
    notifyType String
    The method of sending the alert notification. Valid values: ALERT_MANAGER, DISPATCH_RULE.
    type String
    The type of the alert rule.
    clusterId string
    The ID of the cluster.
    duration string
    The duration of the alert.
    expression string
    The alert rule expression that follows the PromQL syntax.
    message string
    The message of the alert notification.
    prometheusAlertRuleName string
    The name of the resource.
    annotations PrometheusAlertRuleAnnotation[]
    The annotations of the alert rule. See annotations below.
    dispatchRuleId string
    The ID of the notification policy. This parameter is required when the notify_type parameter is set to DISPATCH_RULE.
    labels PrometheusAlertRuleLabel[]
    The labels of the resource. See labels below.
    notifyType string
    The method of sending the alert notification. Valid values: ALERT_MANAGER, DISPATCH_RULE.
    type string
    The type of the alert rule.
    cluster_id str
    The ID of the cluster.
    duration str
    The duration of the alert.
    expression str
    The alert rule expression that follows the PromQL syntax.
    message str
    The message of the alert notification.
    prometheus_alert_rule_name str
    The name of the resource.
    annotations Sequence[PrometheusAlertRuleAnnotationArgs]
    The annotations of the alert rule. See annotations below.
    dispatch_rule_id str
    The ID of the notification policy. This parameter is required when the notify_type parameter is set to DISPATCH_RULE.
    labels Sequence[PrometheusAlertRuleLabelArgs]
    The labels of the resource. See labels below.
    notify_type str
    The method of sending the alert notification. Valid values: ALERT_MANAGER, DISPATCH_RULE.
    type str
    The type of the alert rule.
    clusterId String
    The ID of the cluster.
    duration String
    The duration of the alert.
    expression String
    The alert rule expression that follows the PromQL syntax.
    message String
    The message of the alert notification.
    prometheusAlertRuleName String
    The name of the resource.
    annotations List<Property Map>
    The annotations of the alert rule. See annotations below.
    dispatchRuleId String
    The ID of the notification policy. This parameter is required when the notify_type parameter is set to DISPATCH_RULE.
    labels List<Property Map>
    The labels of the resource. See labels below.
    notifyType String
    The method of sending the alert notification. Valid values: ALERT_MANAGER, DISPATCH_RULE.
    type String
    The type of the alert rule.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    PrometheusAlertRuleId int
    The first ID of the resource.
    Status int
    The status of the resource. Valid values: 0, 1.
    Id string
    The provider-assigned unique ID for this managed resource.
    PrometheusAlertRuleId int
    The first ID of the resource.
    Status int
    The status of the resource. Valid values: 0, 1.
    id String
    The provider-assigned unique ID for this managed resource.
    prometheusAlertRuleId Integer
    The first ID of the resource.
    status Integer
    The status of the resource. Valid values: 0, 1.
    id string
    The provider-assigned unique ID for this managed resource.
    prometheusAlertRuleId number
    The first ID of the resource.
    status number
    The status of the resource. Valid values: 0, 1.
    id str
    The provider-assigned unique ID for this managed resource.
    prometheus_alert_rule_id int
    The first ID of the resource.
    status int
    The status of the resource. Valid values: 0, 1.
    id String
    The provider-assigned unique ID for this managed resource.
    prometheusAlertRuleId Number
    The first ID of the resource.
    status Number
    The status of the resource. Valid values: 0, 1.

    Look up Existing PrometheusAlertRule Resource

    Get an existing PrometheusAlertRule 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?: PrometheusAlertRuleState, opts?: CustomResourceOptions): PrometheusAlertRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            annotations: Optional[Sequence[PrometheusAlertRuleAnnotationArgs]] = None,
            cluster_id: Optional[str] = None,
            dispatch_rule_id: Optional[str] = None,
            duration: Optional[str] = None,
            expression: Optional[str] = None,
            labels: Optional[Sequence[PrometheusAlertRuleLabelArgs]] = None,
            message: Optional[str] = None,
            notify_type: Optional[str] = None,
            prometheus_alert_rule_id: Optional[int] = None,
            prometheus_alert_rule_name: Optional[str] = None,
            status: Optional[int] = None,
            type: Optional[str] = None) -> PrometheusAlertRule
    func GetPrometheusAlertRule(ctx *Context, name string, id IDInput, state *PrometheusAlertRuleState, opts ...ResourceOption) (*PrometheusAlertRule, error)
    public static PrometheusAlertRule Get(string name, Input<string> id, PrometheusAlertRuleState? state, CustomResourceOptions? opts = null)
    public static PrometheusAlertRule get(String name, Output<String> id, PrometheusAlertRuleState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    Annotations List<Pulumi.AliCloud.Arms.Inputs.PrometheusAlertRuleAnnotation>
    The annotations of the alert rule. See annotations below.
    ClusterId string
    The ID of the cluster.
    DispatchRuleId string
    The ID of the notification policy. This parameter is required when the notify_type parameter is set to DISPATCH_RULE.
    Duration string
    The duration of the alert.
    Expression string
    The alert rule expression that follows the PromQL syntax.
    Labels List<Pulumi.AliCloud.Arms.Inputs.PrometheusAlertRuleLabel>
    The labels of the resource. See labels below.
    Message string
    The message of the alert notification.
    NotifyType string
    The method of sending the alert notification. Valid values: ALERT_MANAGER, DISPATCH_RULE.
    PrometheusAlertRuleId int
    The first ID of the resource.
    PrometheusAlertRuleName string
    The name of the resource.
    Status int
    The status of the resource. Valid values: 0, 1.
    Type string
    The type of the alert rule.
    Annotations []PrometheusAlertRuleAnnotationArgs
    The annotations of the alert rule. See annotations below.
    ClusterId string
    The ID of the cluster.
    DispatchRuleId string
    The ID of the notification policy. This parameter is required when the notify_type parameter is set to DISPATCH_RULE.
    Duration string
    The duration of the alert.
    Expression string
    The alert rule expression that follows the PromQL syntax.
    Labels []PrometheusAlertRuleLabelArgs
    The labels of the resource. See labels below.
    Message string
    The message of the alert notification.
    NotifyType string
    The method of sending the alert notification. Valid values: ALERT_MANAGER, DISPATCH_RULE.
    PrometheusAlertRuleId int
    The first ID of the resource.
    PrometheusAlertRuleName string
    The name of the resource.
    Status int
    The status of the resource. Valid values: 0, 1.
    Type string
    The type of the alert rule.
    annotations List<PrometheusAlertRuleAnnotation>
    The annotations of the alert rule. See annotations below.
    clusterId String
    The ID of the cluster.
    dispatchRuleId String
    The ID of the notification policy. This parameter is required when the notify_type parameter is set to DISPATCH_RULE.
    duration String
    The duration of the alert.
    expression String
    The alert rule expression that follows the PromQL syntax.
    labels List<PrometheusAlertRuleLabel>
    The labels of the resource. See labels below.
    message String
    The message of the alert notification.
    notifyType String
    The method of sending the alert notification. Valid values: ALERT_MANAGER, DISPATCH_RULE.
    prometheusAlertRuleId Integer
    The first ID of the resource.
    prometheusAlertRuleName String
    The name of the resource.
    status Integer
    The status of the resource. Valid values: 0, 1.
    type String
    The type of the alert rule.
    annotations PrometheusAlertRuleAnnotation[]
    The annotations of the alert rule. See annotations below.
    clusterId string
    The ID of the cluster.
    dispatchRuleId string
    The ID of the notification policy. This parameter is required when the notify_type parameter is set to DISPATCH_RULE.
    duration string
    The duration of the alert.
    expression string
    The alert rule expression that follows the PromQL syntax.
    labels PrometheusAlertRuleLabel[]
    The labels of the resource. See labels below.
    message string
    The message of the alert notification.
    notifyType string
    The method of sending the alert notification. Valid values: ALERT_MANAGER, DISPATCH_RULE.
    prometheusAlertRuleId number
    The first ID of the resource.
    prometheusAlertRuleName string
    The name of the resource.
    status number
    The status of the resource. Valid values: 0, 1.
    type string
    The type of the alert rule.
    annotations Sequence[PrometheusAlertRuleAnnotationArgs]
    The annotations of the alert rule. See annotations below.
    cluster_id str
    The ID of the cluster.
    dispatch_rule_id str
    The ID of the notification policy. This parameter is required when the notify_type parameter is set to DISPATCH_RULE.
    duration str
    The duration of the alert.
    expression str
    The alert rule expression that follows the PromQL syntax.
    labels Sequence[PrometheusAlertRuleLabelArgs]
    The labels of the resource. See labels below.
    message str
    The message of the alert notification.
    notify_type str
    The method of sending the alert notification. Valid values: ALERT_MANAGER, DISPATCH_RULE.
    prometheus_alert_rule_id int
    The first ID of the resource.
    prometheus_alert_rule_name str
    The name of the resource.
    status int
    The status of the resource. Valid values: 0, 1.
    type str
    The type of the alert rule.
    annotations List<Property Map>
    The annotations of the alert rule. See annotations below.
    clusterId String
    The ID of the cluster.
    dispatchRuleId String
    The ID of the notification policy. This parameter is required when the notify_type parameter is set to DISPATCH_RULE.
    duration String
    The duration of the alert.
    expression String
    The alert rule expression that follows the PromQL syntax.
    labels List<Property Map>
    The labels of the resource. See labels below.
    message String
    The message of the alert notification.
    notifyType String
    The method of sending the alert notification. Valid values: ALERT_MANAGER, DISPATCH_RULE.
    prometheusAlertRuleId Number
    The first ID of the resource.
    prometheusAlertRuleName String
    The name of the resource.
    status Number
    The status of the resource. Valid values: 0, 1.
    type String
    The type of the alert rule.

    Supporting Types

    PrometheusAlertRuleAnnotation, PrometheusAlertRuleAnnotationArgs

    Name string
    The name of the annotation.
    Value string
    The value of the annotation.
    Name string
    The name of the annotation.
    Value string
    The value of the annotation.
    name String
    The name of the annotation.
    value String
    The value of the annotation.
    name string
    The name of the annotation.
    value string
    The value of the annotation.
    name str
    The name of the annotation.
    value str
    The value of the annotation.
    name String
    The name of the annotation.
    value String
    The value of the annotation.

    PrometheusAlertRuleLabel, PrometheusAlertRuleLabelArgs

    Name string
    The name of the label.
    Value string
    The value of the label.
    Name string
    The name of the label.
    Value string
    The value of the label.
    name String
    The name of the label.
    value String
    The value of the label.
    name string
    The name of the label.
    value string
    The value of the label.
    name str
    The name of the label.
    value str
    The value of the label.
    name String
    The name of the label.
    value String
    The value of the label.

    Import

    Application Real-Time Monitoring Service (ARMS) Prometheus Alert Rule can be imported using the id, e.g.

    $ pulumi import alicloud:arms/prometheusAlertRule:PrometheusAlertRule example <cluster_id>:<prometheus_alert_rule_id>
    

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

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi