1. Packages
  2. Rancher2
  3. API Docs
  4. ClusterAlertRule
Rancher 2 v6.1.1 published on Friday, May 10, 2024 by Pulumi

rancher2.ClusterAlertRule

Explore with Pulumi AI

rancher2 logo
Rancher 2 v6.1.1 published on Friday, May 10, 2024 by Pulumi

    Provides a Rancher v2 Cluster Alert Rule resource. This can be used to create Cluster Alert Rule for Rancher v2 environments and retrieve their information.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as rancher2 from "@pulumi/rancher2";
    
    // Create a new Rancher2 Cluster Alert Group
    const foo = new rancher2.ClusterAlertGroup("foo", {
        clusterId: "<cluster_id>",
        name: "foo",
        description: "Terraform cluster alert group",
        groupIntervalSeconds: 300,
        repeatIntervalSeconds: 3600,
    });
    // Create a new Rancher2 Cluster Alert Rule
    const fooClusterAlertRule = new rancher2.ClusterAlertRule("foo", {
        clusterId: foo.clusterId,
        groupId: foo.id,
        name: "foo",
        groupIntervalSeconds: 600,
        repeatIntervalSeconds: 6000,
    });
    
    import pulumi
    import pulumi_rancher2 as rancher2
    
    # Create a new Rancher2 Cluster Alert Group
    foo = rancher2.ClusterAlertGroup("foo",
        cluster_id="<cluster_id>",
        name="foo",
        description="Terraform cluster alert group",
        group_interval_seconds=300,
        repeat_interval_seconds=3600)
    # Create a new Rancher2 Cluster Alert Rule
    foo_cluster_alert_rule = rancher2.ClusterAlertRule("foo",
        cluster_id=foo.cluster_id,
        group_id=foo.id,
        name="foo",
        group_interval_seconds=600,
        repeat_interval_seconds=6000)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-rancher2/sdk/v6/go/rancher2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Create a new Rancher2 Cluster Alert Group
    		foo, err := rancher2.NewClusterAlertGroup(ctx, "foo", &rancher2.ClusterAlertGroupArgs{
    			ClusterId:             pulumi.String("<cluster_id>"),
    			Name:                  pulumi.String("foo"),
    			Description:           pulumi.String("Terraform cluster alert group"),
    			GroupIntervalSeconds:  pulumi.Int(300),
    			RepeatIntervalSeconds: pulumi.Int(3600),
    		})
    		if err != nil {
    			return err
    		}
    		// Create a new Rancher2 Cluster Alert Rule
    		_, err = rancher2.NewClusterAlertRule(ctx, "foo", &rancher2.ClusterAlertRuleArgs{
    			ClusterId:             foo.ClusterId,
    			GroupId:               foo.ID(),
    			Name:                  pulumi.String("foo"),
    			GroupIntervalSeconds:  pulumi.Int(600),
    			RepeatIntervalSeconds: pulumi.Int(6000),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Rancher2 = Pulumi.Rancher2;
    
    return await Deployment.RunAsync(() => 
    {
        // Create a new Rancher2 Cluster Alert Group
        var foo = new Rancher2.ClusterAlertGroup("foo", new()
        {
            ClusterId = "<cluster_id>",
            Name = "foo",
            Description = "Terraform cluster alert group",
            GroupIntervalSeconds = 300,
            RepeatIntervalSeconds = 3600,
        });
    
        // Create a new Rancher2 Cluster Alert Rule
        var fooClusterAlertRule = new Rancher2.ClusterAlertRule("foo", new()
        {
            ClusterId = foo.ClusterId,
            GroupId = foo.Id,
            Name = "foo",
            GroupIntervalSeconds = 600,
            RepeatIntervalSeconds = 6000,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.rancher2.ClusterAlertGroup;
    import com.pulumi.rancher2.ClusterAlertGroupArgs;
    import com.pulumi.rancher2.ClusterAlertRule;
    import com.pulumi.rancher2.ClusterAlertRuleArgs;
    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) {
            // Create a new Rancher2 Cluster Alert Group
            var foo = new ClusterAlertGroup("foo", ClusterAlertGroupArgs.builder()        
                .clusterId("<cluster_id>")
                .name("foo")
                .description("Terraform cluster alert group")
                .groupIntervalSeconds(300)
                .repeatIntervalSeconds(3600)
                .build());
    
            // Create a new Rancher2 Cluster Alert Rule
            var fooClusterAlertRule = new ClusterAlertRule("fooClusterAlertRule", ClusterAlertRuleArgs.builder()        
                .clusterId(foo.clusterId())
                .groupId(foo.id())
                .name("foo")
                .groupIntervalSeconds(600)
                .repeatIntervalSeconds(6000)
                .build());
    
        }
    }
    
    resources:
      # Create a new Rancher2 Cluster Alert Group
      foo:
        type: rancher2:ClusterAlertGroup
        properties:
          clusterId: <cluster_id>
          name: foo
          description: Terraform cluster alert group
          groupIntervalSeconds: 300
          repeatIntervalSeconds: 3600
      # Create a new Rancher2 Cluster Alert Rule
      fooClusterAlertRule:
        type: rancher2:ClusterAlertRule
        name: foo
        properties:
          clusterId: ${foo.clusterId}
          groupId: ${foo.id}
          name: foo
          groupIntervalSeconds: 600
          repeatIntervalSeconds: 6000
    

    Create ClusterAlertRule Resource

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

    Constructor syntax

    new ClusterAlertRule(name: string, args: ClusterAlertRuleArgs, opts?: CustomResourceOptions);
    @overload
    def ClusterAlertRule(resource_name: str,
                         args: ClusterAlertRuleArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def ClusterAlertRule(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         group_id: Optional[str] = None,
                         cluster_id: Optional[str] = None,
                         inherited: Optional[bool] = None,
                         event_rule: Optional[ClusterAlertRuleEventRuleArgs] = None,
                         group_interval_seconds: Optional[int] = None,
                         group_wait_seconds: Optional[int] = None,
                         annotations: Optional[Mapping[str, Any]] = None,
                         labels: Optional[Mapping[str, Any]] = None,
                         metric_rule: Optional[ClusterAlertRuleMetricRuleArgs] = None,
                         name: Optional[str] = None,
                         node_rule: Optional[ClusterAlertRuleNodeRuleArgs] = None,
                         repeat_interval_seconds: Optional[int] = None,
                         severity: Optional[str] = None,
                         system_service_rule: Optional[ClusterAlertRuleSystemServiceRuleArgs] = None)
    func NewClusterAlertRule(ctx *Context, name string, args ClusterAlertRuleArgs, opts ...ResourceOption) (*ClusterAlertRule, error)
    public ClusterAlertRule(string name, ClusterAlertRuleArgs args, CustomResourceOptions? opts = null)
    public ClusterAlertRule(String name, ClusterAlertRuleArgs args)
    public ClusterAlertRule(String name, ClusterAlertRuleArgs args, CustomResourceOptions options)
    
    type: rancher2:ClusterAlertRule
    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 ClusterAlertRuleArgs
    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 ClusterAlertRuleArgs
    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 ClusterAlertRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ClusterAlertRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ClusterAlertRuleArgs
    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 clusterAlertRuleResource = new Rancher2.ClusterAlertRule("clusterAlertRuleResource", new()
    {
        GroupId = "string",
        ClusterId = "string",
        Inherited = false,
        EventRule = new Rancher2.Inputs.ClusterAlertRuleEventRuleArgs
        {
            ResourceKind = "string",
            EventType = "string",
        },
        GroupIntervalSeconds = 0,
        GroupWaitSeconds = 0,
        Annotations = 
        {
            { "string", "any" },
        },
        Labels = 
        {
            { "string", "any" },
        },
        MetricRule = new Rancher2.Inputs.ClusterAlertRuleMetricRuleArgs
        {
            Duration = "string",
            Expression = "string",
            ThresholdValue = 0,
            Comparison = "string",
            Description = "string",
        },
        Name = "string",
        NodeRule = new Rancher2.Inputs.ClusterAlertRuleNodeRuleArgs
        {
            Condition = "string",
            CpuThreshold = 0,
            MemThreshold = 0,
            NodeId = "string",
            Selector = 
            {
                { "string", "any" },
            },
        },
        RepeatIntervalSeconds = 0,
        Severity = "string",
        SystemServiceRule = new Rancher2.Inputs.ClusterAlertRuleSystemServiceRuleArgs
        {
            Condition = "string",
        },
    });
    
    example, err := rancher2.NewClusterAlertRule(ctx, "clusterAlertRuleResource", &rancher2.ClusterAlertRuleArgs{
    	GroupId:   pulumi.String("string"),
    	ClusterId: pulumi.String("string"),
    	Inherited: pulumi.Bool(false),
    	EventRule: &rancher2.ClusterAlertRuleEventRuleArgs{
    		ResourceKind: pulumi.String("string"),
    		EventType:    pulumi.String("string"),
    	},
    	GroupIntervalSeconds: pulumi.Int(0),
    	GroupWaitSeconds:     pulumi.Int(0),
    	Annotations: pulumi.Map{
    		"string": pulumi.Any("any"),
    	},
    	Labels: pulumi.Map{
    		"string": pulumi.Any("any"),
    	},
    	MetricRule: &rancher2.ClusterAlertRuleMetricRuleArgs{
    		Duration:       pulumi.String("string"),
    		Expression:     pulumi.String("string"),
    		ThresholdValue: pulumi.Float64(0),
    		Comparison:     pulumi.String("string"),
    		Description:    pulumi.String("string"),
    	},
    	Name: pulumi.String("string"),
    	NodeRule: &rancher2.ClusterAlertRuleNodeRuleArgs{
    		Condition:    pulumi.String("string"),
    		CpuThreshold: pulumi.Int(0),
    		MemThreshold: pulumi.Int(0),
    		NodeId:       pulumi.String("string"),
    		Selector: pulumi.Map{
    			"string": pulumi.Any("any"),
    		},
    	},
    	RepeatIntervalSeconds: pulumi.Int(0),
    	Severity:              pulumi.String("string"),
    	SystemServiceRule: &rancher2.ClusterAlertRuleSystemServiceRuleArgs{
    		Condition: pulumi.String("string"),
    	},
    })
    
    var clusterAlertRuleResource = new ClusterAlertRule("clusterAlertRuleResource", ClusterAlertRuleArgs.builder()
        .groupId("string")
        .clusterId("string")
        .inherited(false)
        .eventRule(ClusterAlertRuleEventRuleArgs.builder()
            .resourceKind("string")
            .eventType("string")
            .build())
        .groupIntervalSeconds(0)
        .groupWaitSeconds(0)
        .annotations(Map.of("string", "any"))
        .labels(Map.of("string", "any"))
        .metricRule(ClusterAlertRuleMetricRuleArgs.builder()
            .duration("string")
            .expression("string")
            .thresholdValue(0)
            .comparison("string")
            .description("string")
            .build())
        .name("string")
        .nodeRule(ClusterAlertRuleNodeRuleArgs.builder()
            .condition("string")
            .cpuThreshold(0)
            .memThreshold(0)
            .nodeId("string")
            .selector(Map.of("string", "any"))
            .build())
        .repeatIntervalSeconds(0)
        .severity("string")
        .systemServiceRule(ClusterAlertRuleSystemServiceRuleArgs.builder()
            .condition("string")
            .build())
        .build());
    
    cluster_alert_rule_resource = rancher2.ClusterAlertRule("clusterAlertRuleResource",
        group_id="string",
        cluster_id="string",
        inherited=False,
        event_rule=rancher2.ClusterAlertRuleEventRuleArgs(
            resource_kind="string",
            event_type="string",
        ),
        group_interval_seconds=0,
        group_wait_seconds=0,
        annotations={
            "string": "any",
        },
        labels={
            "string": "any",
        },
        metric_rule=rancher2.ClusterAlertRuleMetricRuleArgs(
            duration="string",
            expression="string",
            threshold_value=0,
            comparison="string",
            description="string",
        ),
        name="string",
        node_rule=rancher2.ClusterAlertRuleNodeRuleArgs(
            condition="string",
            cpu_threshold=0,
            mem_threshold=0,
            node_id="string",
            selector={
                "string": "any",
            },
        ),
        repeat_interval_seconds=0,
        severity="string",
        system_service_rule=rancher2.ClusterAlertRuleSystemServiceRuleArgs(
            condition="string",
        ))
    
    const clusterAlertRuleResource = new rancher2.ClusterAlertRule("clusterAlertRuleResource", {
        groupId: "string",
        clusterId: "string",
        inherited: false,
        eventRule: {
            resourceKind: "string",
            eventType: "string",
        },
        groupIntervalSeconds: 0,
        groupWaitSeconds: 0,
        annotations: {
            string: "any",
        },
        labels: {
            string: "any",
        },
        metricRule: {
            duration: "string",
            expression: "string",
            thresholdValue: 0,
            comparison: "string",
            description: "string",
        },
        name: "string",
        nodeRule: {
            condition: "string",
            cpuThreshold: 0,
            memThreshold: 0,
            nodeId: "string",
            selector: {
                string: "any",
            },
        },
        repeatIntervalSeconds: 0,
        severity: "string",
        systemServiceRule: {
            condition: "string",
        },
    });
    
    type: rancher2:ClusterAlertRule
    properties:
        annotations:
            string: any
        clusterId: string
        eventRule:
            eventType: string
            resourceKind: string
        groupId: string
        groupIntervalSeconds: 0
        groupWaitSeconds: 0
        inherited: false
        labels:
            string: any
        metricRule:
            comparison: string
            description: string
            duration: string
            expression: string
            thresholdValue: 0
        name: string
        nodeRule:
            condition: string
            cpuThreshold: 0
            memThreshold: 0
            nodeId: string
            selector:
                string: any
        repeatIntervalSeconds: 0
        severity: string
        systemServiceRule:
            condition: string
    

    ClusterAlertRule 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 ClusterAlertRule resource accepts the following input properties:

    ClusterId string
    The cluster id where create cluster alert rule (string)
    GroupId string
    The cluster alert rule alert group ID (string)
    Annotations Dictionary<string, object>
    The cluster alert rule annotations (map)
    EventRule ClusterAlertRuleEventRule
    The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    GroupIntervalSeconds int
    The cluster alert rule group interval seconds. Default: 180 (int)
    GroupWaitSeconds int
    The cluster alert rule group wait seconds. Default: 180 (int)
    Inherited bool
    The cluster alert rule inherited. Default: true (bool)
    Labels Dictionary<string, object>
    The cluster alert rule labels (map)
    MetricRule ClusterAlertRuleMetricRule
    The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    Name string
    The cluster alert rule name (string)
    NodeRule ClusterAlertRuleNodeRule
    The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
    RepeatIntervalSeconds int
    The cluster alert rule wait seconds. Default: 3600 (int)
    Severity string
    The cluster alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    SystemServiceRule ClusterAlertRuleSystemServiceRule
    The cluster alert rule system service rule. ConflictsWith: "event_rule", "metric_rule", "node_rule" (list Maxitems:1)
    ClusterId string
    The cluster id where create cluster alert rule (string)
    GroupId string
    The cluster alert rule alert group ID (string)
    Annotations map[string]interface{}
    The cluster alert rule annotations (map)
    EventRule ClusterAlertRuleEventRuleArgs
    The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    GroupIntervalSeconds int
    The cluster alert rule group interval seconds. Default: 180 (int)
    GroupWaitSeconds int
    The cluster alert rule group wait seconds. Default: 180 (int)
    Inherited bool
    The cluster alert rule inherited. Default: true (bool)
    Labels map[string]interface{}
    The cluster alert rule labels (map)
    MetricRule ClusterAlertRuleMetricRuleArgs
    The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    Name string
    The cluster alert rule name (string)
    NodeRule ClusterAlertRuleNodeRuleArgs
    The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
    RepeatIntervalSeconds int
    The cluster alert rule wait seconds. Default: 3600 (int)
    Severity string
    The cluster alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    SystemServiceRule ClusterAlertRuleSystemServiceRuleArgs
    The cluster alert rule system service rule. ConflictsWith: "event_rule", "metric_rule", "node_rule" (list Maxitems:1)
    clusterId String
    The cluster id where create cluster alert rule (string)
    groupId String
    The cluster alert rule alert group ID (string)
    annotations Map<String,Object>
    The cluster alert rule annotations (map)
    eventRule ClusterAlertRuleEventRule
    The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    groupIntervalSeconds Integer
    The cluster alert rule group interval seconds. Default: 180 (int)
    groupWaitSeconds Integer
    The cluster alert rule group wait seconds. Default: 180 (int)
    inherited Boolean
    The cluster alert rule inherited. Default: true (bool)
    labels Map<String,Object>
    The cluster alert rule labels (map)
    metricRule ClusterAlertRuleMetricRule
    The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    name String
    The cluster alert rule name (string)
    nodeRule ClusterAlertRuleNodeRule
    The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
    repeatIntervalSeconds Integer
    The cluster alert rule wait seconds. Default: 3600 (int)
    severity String
    The cluster alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    systemServiceRule ClusterAlertRuleSystemServiceRule
    The cluster alert rule system service rule. ConflictsWith: "event_rule", "metric_rule", "node_rule" (list Maxitems:1)
    clusterId string
    The cluster id where create cluster alert rule (string)
    groupId string
    The cluster alert rule alert group ID (string)
    annotations {[key: string]: any}
    The cluster alert rule annotations (map)
    eventRule ClusterAlertRuleEventRule
    The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    groupIntervalSeconds number
    The cluster alert rule group interval seconds. Default: 180 (int)
    groupWaitSeconds number
    The cluster alert rule group wait seconds. Default: 180 (int)
    inherited boolean
    The cluster alert rule inherited. Default: true (bool)
    labels {[key: string]: any}
    The cluster alert rule labels (map)
    metricRule ClusterAlertRuleMetricRule
    The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    name string
    The cluster alert rule name (string)
    nodeRule ClusterAlertRuleNodeRule
    The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
    repeatIntervalSeconds number
    The cluster alert rule wait seconds. Default: 3600 (int)
    severity string
    The cluster alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    systemServiceRule ClusterAlertRuleSystemServiceRule
    The cluster alert rule system service rule. ConflictsWith: "event_rule", "metric_rule", "node_rule" (list Maxitems:1)
    cluster_id str
    The cluster id where create cluster alert rule (string)
    group_id str
    The cluster alert rule alert group ID (string)
    annotations Mapping[str, Any]
    The cluster alert rule annotations (map)
    event_rule ClusterAlertRuleEventRuleArgs
    The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    group_interval_seconds int
    The cluster alert rule group interval seconds. Default: 180 (int)
    group_wait_seconds int
    The cluster alert rule group wait seconds. Default: 180 (int)
    inherited bool
    The cluster alert rule inherited. Default: true (bool)
    labels Mapping[str, Any]
    The cluster alert rule labels (map)
    metric_rule ClusterAlertRuleMetricRuleArgs
    The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    name str
    The cluster alert rule name (string)
    node_rule ClusterAlertRuleNodeRuleArgs
    The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
    repeat_interval_seconds int
    The cluster alert rule wait seconds. Default: 3600 (int)
    severity str
    The cluster alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    system_service_rule ClusterAlertRuleSystemServiceRuleArgs
    The cluster alert rule system service rule. ConflictsWith: "event_rule", "metric_rule", "node_rule" (list Maxitems:1)
    clusterId String
    The cluster id where create cluster alert rule (string)
    groupId String
    The cluster alert rule alert group ID (string)
    annotations Map<Any>
    The cluster alert rule annotations (map)
    eventRule Property Map
    The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    groupIntervalSeconds Number
    The cluster alert rule group interval seconds. Default: 180 (int)
    groupWaitSeconds Number
    The cluster alert rule group wait seconds. Default: 180 (int)
    inherited Boolean
    The cluster alert rule inherited. Default: true (bool)
    labels Map<Any>
    The cluster alert rule labels (map)
    metricRule Property Map
    The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    name String
    The cluster alert rule name (string)
    nodeRule Property Map
    The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
    repeatIntervalSeconds Number
    The cluster alert rule wait seconds. Default: 3600 (int)
    severity String
    The cluster alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    systemServiceRule Property Map
    The cluster alert rule system service rule. ConflictsWith: "event_rule", "metric_rule", "node_rule" (list Maxitems:1)

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ClusterAlertRule Resource

    Get an existing ClusterAlertRule 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?: ClusterAlertRuleState, opts?: CustomResourceOptions): ClusterAlertRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            annotations: Optional[Mapping[str, Any]] = None,
            cluster_id: Optional[str] = None,
            event_rule: Optional[ClusterAlertRuleEventRuleArgs] = None,
            group_id: Optional[str] = None,
            group_interval_seconds: Optional[int] = None,
            group_wait_seconds: Optional[int] = None,
            inherited: Optional[bool] = None,
            labels: Optional[Mapping[str, Any]] = None,
            metric_rule: Optional[ClusterAlertRuleMetricRuleArgs] = None,
            name: Optional[str] = None,
            node_rule: Optional[ClusterAlertRuleNodeRuleArgs] = None,
            repeat_interval_seconds: Optional[int] = None,
            severity: Optional[str] = None,
            system_service_rule: Optional[ClusterAlertRuleSystemServiceRuleArgs] = None) -> ClusterAlertRule
    func GetClusterAlertRule(ctx *Context, name string, id IDInput, state *ClusterAlertRuleState, opts ...ResourceOption) (*ClusterAlertRule, error)
    public static ClusterAlertRule Get(string name, Input<string> id, ClusterAlertRuleState? state, CustomResourceOptions? opts = null)
    public static ClusterAlertRule get(String name, Output<String> id, ClusterAlertRuleState 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 Dictionary<string, object>
    The cluster alert rule annotations (map)
    ClusterId string
    The cluster id where create cluster alert rule (string)
    EventRule ClusterAlertRuleEventRule
    The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    GroupId string
    The cluster alert rule alert group ID (string)
    GroupIntervalSeconds int
    The cluster alert rule group interval seconds. Default: 180 (int)
    GroupWaitSeconds int
    The cluster alert rule group wait seconds. Default: 180 (int)
    Inherited bool
    The cluster alert rule inherited. Default: true (bool)
    Labels Dictionary<string, object>
    The cluster alert rule labels (map)
    MetricRule ClusterAlertRuleMetricRule
    The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    Name string
    The cluster alert rule name (string)
    NodeRule ClusterAlertRuleNodeRule
    The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
    RepeatIntervalSeconds int
    The cluster alert rule wait seconds. Default: 3600 (int)
    Severity string
    The cluster alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    SystemServiceRule ClusterAlertRuleSystemServiceRule
    The cluster alert rule system service rule. ConflictsWith: "event_rule", "metric_rule", "node_rule" (list Maxitems:1)
    Annotations map[string]interface{}
    The cluster alert rule annotations (map)
    ClusterId string
    The cluster id where create cluster alert rule (string)
    EventRule ClusterAlertRuleEventRuleArgs
    The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    GroupId string
    The cluster alert rule alert group ID (string)
    GroupIntervalSeconds int
    The cluster alert rule group interval seconds. Default: 180 (int)
    GroupWaitSeconds int
    The cluster alert rule group wait seconds. Default: 180 (int)
    Inherited bool
    The cluster alert rule inherited. Default: true (bool)
    Labels map[string]interface{}
    The cluster alert rule labels (map)
    MetricRule ClusterAlertRuleMetricRuleArgs
    The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    Name string
    The cluster alert rule name (string)
    NodeRule ClusterAlertRuleNodeRuleArgs
    The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
    RepeatIntervalSeconds int
    The cluster alert rule wait seconds. Default: 3600 (int)
    Severity string
    The cluster alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    SystemServiceRule ClusterAlertRuleSystemServiceRuleArgs
    The cluster alert rule system service rule. ConflictsWith: "event_rule", "metric_rule", "node_rule" (list Maxitems:1)
    annotations Map<String,Object>
    The cluster alert rule annotations (map)
    clusterId String
    The cluster id where create cluster alert rule (string)
    eventRule ClusterAlertRuleEventRule
    The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    groupId String
    The cluster alert rule alert group ID (string)
    groupIntervalSeconds Integer
    The cluster alert rule group interval seconds. Default: 180 (int)
    groupWaitSeconds Integer
    The cluster alert rule group wait seconds. Default: 180 (int)
    inherited Boolean
    The cluster alert rule inherited. Default: true (bool)
    labels Map<String,Object>
    The cluster alert rule labels (map)
    metricRule ClusterAlertRuleMetricRule
    The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    name String
    The cluster alert rule name (string)
    nodeRule ClusterAlertRuleNodeRule
    The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
    repeatIntervalSeconds Integer
    The cluster alert rule wait seconds. Default: 3600 (int)
    severity String
    The cluster alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    systemServiceRule ClusterAlertRuleSystemServiceRule
    The cluster alert rule system service rule. ConflictsWith: "event_rule", "metric_rule", "node_rule" (list Maxitems:1)
    annotations {[key: string]: any}
    The cluster alert rule annotations (map)
    clusterId string
    The cluster id where create cluster alert rule (string)
    eventRule ClusterAlertRuleEventRule
    The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    groupId string
    The cluster alert rule alert group ID (string)
    groupIntervalSeconds number
    The cluster alert rule group interval seconds. Default: 180 (int)
    groupWaitSeconds number
    The cluster alert rule group wait seconds. Default: 180 (int)
    inherited boolean
    The cluster alert rule inherited. Default: true (bool)
    labels {[key: string]: any}
    The cluster alert rule labels (map)
    metricRule ClusterAlertRuleMetricRule
    The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    name string
    The cluster alert rule name (string)
    nodeRule ClusterAlertRuleNodeRule
    The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
    repeatIntervalSeconds number
    The cluster alert rule wait seconds. Default: 3600 (int)
    severity string
    The cluster alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    systemServiceRule ClusterAlertRuleSystemServiceRule
    The cluster alert rule system service rule. ConflictsWith: "event_rule", "metric_rule", "node_rule" (list Maxitems:1)
    annotations Mapping[str, Any]
    The cluster alert rule annotations (map)
    cluster_id str
    The cluster id where create cluster alert rule (string)
    event_rule ClusterAlertRuleEventRuleArgs
    The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    group_id str
    The cluster alert rule alert group ID (string)
    group_interval_seconds int
    The cluster alert rule group interval seconds. Default: 180 (int)
    group_wait_seconds int
    The cluster alert rule group wait seconds. Default: 180 (int)
    inherited bool
    The cluster alert rule inherited. Default: true (bool)
    labels Mapping[str, Any]
    The cluster alert rule labels (map)
    metric_rule ClusterAlertRuleMetricRuleArgs
    The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    name str
    The cluster alert rule name (string)
    node_rule ClusterAlertRuleNodeRuleArgs
    The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
    repeat_interval_seconds int
    The cluster alert rule wait seconds. Default: 3600 (int)
    severity str
    The cluster alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    system_service_rule ClusterAlertRuleSystemServiceRuleArgs
    The cluster alert rule system service rule. ConflictsWith: "event_rule", "metric_rule", "node_rule" (list Maxitems:1)
    annotations Map<Any>
    The cluster alert rule annotations (map)
    clusterId String
    The cluster id where create cluster alert rule (string)
    eventRule Property Map
    The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    groupId String
    The cluster alert rule alert group ID (string)
    groupIntervalSeconds Number
    The cluster alert rule group interval seconds. Default: 180 (int)
    groupWaitSeconds Number
    The cluster alert rule group wait seconds. Default: 180 (int)
    inherited Boolean
    The cluster alert rule inherited. Default: true (bool)
    labels Map<Any>
    The cluster alert rule labels (map)
    metricRule Property Map
    The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    name String
    The cluster alert rule name (string)
    nodeRule Property Map
    The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
    repeatIntervalSeconds Number
    The cluster alert rule wait seconds. Default: 3600 (int)
    severity String
    The cluster alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    systemServiceRule Property Map
    The cluster alert rule system service rule. ConflictsWith: "event_rule", "metric_rule", "node_rule" (list Maxitems:1)

    Supporting Types

    ClusterAlertRuleEventRule, ClusterAlertRuleEventRuleArgs

    ResourceKind string
    Resource kind
    EventType string
    Event type
    ResourceKind string
    Resource kind
    EventType string
    Event type
    resourceKind String
    Resource kind
    eventType String
    Event type
    resourceKind string
    Resource kind
    eventType string
    Event type
    resource_kind str
    Resource kind
    event_type str
    Event type
    resourceKind String
    Resource kind
    eventType String
    Event type

    ClusterAlertRuleMetricRule, ClusterAlertRuleMetricRuleArgs

    Duration string
    Metric rule duration
    Expression string
    Metric rule expression
    ThresholdValue double
    Metric rule threshold value
    Comparison string
    Metric rule comparison
    Description string
    Metric rule description
    Duration string
    Metric rule duration
    Expression string
    Metric rule expression
    ThresholdValue float64
    Metric rule threshold value
    Comparison string
    Metric rule comparison
    Description string
    Metric rule description
    duration String
    Metric rule duration
    expression String
    Metric rule expression
    thresholdValue Double
    Metric rule threshold value
    comparison String
    Metric rule comparison
    description String
    Metric rule description
    duration string
    Metric rule duration
    expression string
    Metric rule expression
    thresholdValue number
    Metric rule threshold value
    comparison string
    Metric rule comparison
    description string
    Metric rule description
    duration str
    Metric rule duration
    expression str
    Metric rule expression
    threshold_value float
    Metric rule threshold value
    comparison str
    Metric rule comparison
    description str
    Metric rule description
    duration String
    Metric rule duration
    expression String
    Metric rule expression
    thresholdValue Number
    Metric rule threshold value
    comparison String
    Metric rule comparison
    description String
    Metric rule description

    ClusterAlertRuleNodeRule, ClusterAlertRuleNodeRuleArgs

    Condition string
    Node rule condition
    CpuThreshold int
    Node rule cpu threshold
    MemThreshold int
    Node rule mem threshold
    NodeId string
    Node ID
    Selector Dictionary<string, object>
    Node rule selector
    Condition string
    Node rule condition
    CpuThreshold int
    Node rule cpu threshold
    MemThreshold int
    Node rule mem threshold
    NodeId string
    Node ID
    Selector map[string]interface{}
    Node rule selector
    condition String
    Node rule condition
    cpuThreshold Integer
    Node rule cpu threshold
    memThreshold Integer
    Node rule mem threshold
    nodeId String
    Node ID
    selector Map<String,Object>
    Node rule selector
    condition string
    Node rule condition
    cpuThreshold number
    Node rule cpu threshold
    memThreshold number
    Node rule mem threshold
    nodeId string
    Node ID
    selector {[key: string]: any}
    Node rule selector
    condition str
    Node rule condition
    cpu_threshold int
    Node rule cpu threshold
    mem_threshold int
    Node rule mem threshold
    node_id str
    Node ID
    selector Mapping[str, Any]
    Node rule selector
    condition String
    Node rule condition
    cpuThreshold Number
    Node rule cpu threshold
    memThreshold Number
    Node rule mem threshold
    nodeId String
    Node ID
    selector Map<Any>
    Node rule selector

    ClusterAlertRuleSystemServiceRule, ClusterAlertRuleSystemServiceRuleArgs

    Condition string
    System service rule condition
    Condition string
    System service rule condition
    condition String
    System service rule condition
    condition string
    System service rule condition
    condition str
    System service rule condition
    condition String
    System service rule condition

    Import

    Cluster Alert Rule can be imported using the Rancher cluster alert rule ID

    $ pulumi import rancher2:index/clusterAlertRule:ClusterAlertRule foo &lt;CLUSTER_ALERT_RULE_ID&gt;
    

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

    Package Details

    Repository
    Rancher2 pulumi/pulumi-rancher2
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the rancher2 Terraform Provider.
    rancher2 logo
    Rancher 2 v6.1.1 published on Friday, May 10, 2024 by Pulumi