rancher2.ClusterAlertRule
Explore with Pulumi AI
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:
- Cluster
Id string - The cluster id where create cluster alert rule (string)
- Group
Id string - The cluster alert rule alert group ID (string)
- Annotations Dictionary<string, object>
- The cluster alert rule annotations (map)
- Event
Rule ClusterAlert Rule Event Rule - The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
- Group
Interval intSeconds - The cluster alert rule group interval seconds. Default:
180
(int) - Group
Wait intSeconds - 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)
- Metric
Rule ClusterAlert Rule Metric Rule - 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)
- Node
Rule ClusterAlert Rule Node Rule - The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
- Repeat
Interval intSeconds - The cluster alert rule wait seconds. Default:
3600
(int) - Severity string
- The cluster alert rule severity. Supported values :
"critical" | "info" | "warning"
. Default:critical
(string) - System
Service ClusterRule Alert Rule System Service Rule - The cluster alert rule system service rule. ConflictsWith:
"event_rule", "metric_rule", "node_rule"
(list Maxitems:1)
- Cluster
Id string - The cluster id where create cluster alert rule (string)
- Group
Id string - The cluster alert rule alert group ID (string)
- Annotations map[string]interface{}
- The cluster alert rule annotations (map)
- Event
Rule ClusterAlert Rule Event Rule Args - The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
- Group
Interval intSeconds - The cluster alert rule group interval seconds. Default:
180
(int) - Group
Wait intSeconds - 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)
- Metric
Rule ClusterAlert Rule Metric Rule Args - 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)
- Node
Rule ClusterAlert Rule Node Rule Args - The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
- Repeat
Interval intSeconds - The cluster alert rule wait seconds. Default:
3600
(int) - Severity string
- The cluster alert rule severity. Supported values :
"critical" | "info" | "warning"
. Default:critical
(string) - System
Service ClusterRule Alert Rule System Service Rule Args - The cluster alert rule system service rule. ConflictsWith:
"event_rule", "metric_rule", "node_rule"
(list Maxitems:1)
- cluster
Id String - The cluster id where create cluster alert rule (string)
- group
Id String - The cluster alert rule alert group ID (string)
- annotations Map<String,Object>
- The cluster alert rule annotations (map)
- event
Rule ClusterAlert Rule Event Rule - The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
- group
Interval IntegerSeconds - The cluster alert rule group interval seconds. Default:
180
(int) - group
Wait IntegerSeconds - 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)
- metric
Rule ClusterAlert Rule Metric Rule - 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)
- node
Rule ClusterAlert Rule Node Rule - The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
- repeat
Interval IntegerSeconds - The cluster alert rule wait seconds. Default:
3600
(int) - severity String
- The cluster alert rule severity. Supported values :
"critical" | "info" | "warning"
. Default:critical
(string) - system
Service ClusterRule Alert Rule System Service Rule - The cluster alert rule system service rule. ConflictsWith:
"event_rule", "metric_rule", "node_rule"
(list Maxitems:1)
- cluster
Id string - The cluster id where create cluster alert rule (string)
- group
Id string - The cluster alert rule alert group ID (string)
- annotations {[key: string]: any}
- The cluster alert rule annotations (map)
- event
Rule ClusterAlert Rule Event Rule - The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
- group
Interval numberSeconds - The cluster alert rule group interval seconds. Default:
180
(int) - group
Wait numberSeconds - 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)
- metric
Rule ClusterAlert Rule Metric Rule - 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)
- node
Rule ClusterAlert Rule Node Rule - The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
- repeat
Interval numberSeconds - The cluster alert rule wait seconds. Default:
3600
(int) - severity string
- The cluster alert rule severity. Supported values :
"critical" | "info" | "warning"
. Default:critical
(string) - system
Service ClusterRule Alert Rule System Service Rule - 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 ClusterAlert Rule Event Rule Args - The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
- group_
interval_ intseconds - The cluster alert rule group interval seconds. Default:
180
(int) - group_
wait_ intseconds - 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 ClusterAlert Rule Metric Rule Args - 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 ClusterAlert Rule Node Rule Args - The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
- repeat_
interval_ intseconds - 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_ Clusterrule Alert Rule System Service Rule Args - The cluster alert rule system service rule. ConflictsWith:
"event_rule", "metric_rule", "node_rule"
(list Maxitems:1)
- cluster
Id String - The cluster id where create cluster alert rule (string)
- group
Id String - The cluster alert rule alert group ID (string)
- annotations Map<Any>
- The cluster alert rule annotations (map)
- event
Rule Property Map - The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
- group
Interval NumberSeconds - The cluster alert rule group interval seconds. Default:
180
(int) - group
Wait NumberSeconds - 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)
- metric
Rule 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)
- node
Rule Property Map - The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
- repeat
Interval NumberSeconds - The cluster alert rule wait seconds. Default:
3600
(int) - severity String
- The cluster alert rule severity. Supported values :
"critical" | "info" | "warning"
. Default:critical
(string) - system
Service Property MapRule - 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.
- Annotations Dictionary<string, object>
- The cluster alert rule annotations (map)
- Cluster
Id string - The cluster id where create cluster alert rule (string)
- Event
Rule ClusterAlert Rule Event Rule - The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
- Group
Id string - The cluster alert rule alert group ID (string)
- Group
Interval intSeconds - The cluster alert rule group interval seconds. Default:
180
(int) - Group
Wait intSeconds - 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)
- Metric
Rule ClusterAlert Rule Metric Rule - 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)
- Node
Rule ClusterAlert Rule Node Rule - The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
- Repeat
Interval intSeconds - The cluster alert rule wait seconds. Default:
3600
(int) - Severity string
- The cluster alert rule severity. Supported values :
"critical" | "info" | "warning"
. Default:critical
(string) - System
Service ClusterRule Alert Rule System Service Rule - 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)
- Cluster
Id string - The cluster id where create cluster alert rule (string)
- Event
Rule ClusterAlert Rule Event Rule Args - The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
- Group
Id string - The cluster alert rule alert group ID (string)
- Group
Interval intSeconds - The cluster alert rule group interval seconds. Default:
180
(int) - Group
Wait intSeconds - 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)
- Metric
Rule ClusterAlert Rule Metric Rule Args - 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)
- Node
Rule ClusterAlert Rule Node Rule Args - The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
- Repeat
Interval intSeconds - The cluster alert rule wait seconds. Default:
3600
(int) - Severity string
- The cluster alert rule severity. Supported values :
"critical" | "info" | "warning"
. Default:critical
(string) - System
Service ClusterRule Alert Rule System Service Rule Args - 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)
- cluster
Id String - The cluster id where create cluster alert rule (string)
- event
Rule ClusterAlert Rule Event Rule - The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
- group
Id String - The cluster alert rule alert group ID (string)
- group
Interval IntegerSeconds - The cluster alert rule group interval seconds. Default:
180
(int) - group
Wait IntegerSeconds - 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)
- metric
Rule ClusterAlert Rule Metric Rule - 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)
- node
Rule ClusterAlert Rule Node Rule - The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
- repeat
Interval IntegerSeconds - The cluster alert rule wait seconds. Default:
3600
(int) - severity String
- The cluster alert rule severity. Supported values :
"critical" | "info" | "warning"
. Default:critical
(string) - system
Service ClusterRule Alert Rule System Service Rule - 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)
- cluster
Id string - The cluster id where create cluster alert rule (string)
- event
Rule ClusterAlert Rule Event Rule - The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
- group
Id string - The cluster alert rule alert group ID (string)
- group
Interval numberSeconds - The cluster alert rule group interval seconds. Default:
180
(int) - group
Wait numberSeconds - 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)
- metric
Rule ClusterAlert Rule Metric Rule - 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)
- node
Rule ClusterAlert Rule Node Rule - The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
- repeat
Interval numberSeconds - The cluster alert rule wait seconds. Default:
3600
(int) - severity string
- The cluster alert rule severity. Supported values :
"critical" | "info" | "warning"
. Default:critical
(string) - system
Service ClusterRule Alert Rule System Service Rule - 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 ClusterAlert Rule Event Rule Args - 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_ intseconds - The cluster alert rule group interval seconds. Default:
180
(int) - group_
wait_ intseconds - 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 ClusterAlert Rule Metric Rule Args - 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 ClusterAlert Rule Node Rule Args - The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
- repeat_
interval_ intseconds - 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_ Clusterrule Alert Rule System Service Rule Args - 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)
- cluster
Id String - The cluster id where create cluster alert rule (string)
- event
Rule Property Map - The cluster alert rule event rule. ConflictsWith: `"metric_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
- group
Id String - The cluster alert rule alert group ID (string)
- group
Interval NumberSeconds - The cluster alert rule group interval seconds. Default:
180
(int) - group
Wait NumberSeconds - 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)
- metric
Rule 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)
- node
Rule Property Map - The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
- repeat
Interval NumberSeconds - The cluster alert rule wait seconds. Default:
3600
(int) - severity String
- The cluster alert rule severity. Supported values :
"critical" | "info" | "warning"
. Default:critical
(string) - system
Service Property MapRule - The cluster alert rule system service rule. ConflictsWith:
"event_rule", "metric_rule", "node_rule"
(list Maxitems:1)
Supporting Types
ClusterAlertRuleEventRule, ClusterAlertRuleEventRuleArgs
- Resource
Kind string - Resource kind
- Event
Type string - Event type
- Resource
Kind string - Resource kind
- Event
Type string - Event type
- resource
Kind String - Resource kind
- event
Type String - Event type
- resource
Kind string - Resource kind
- event
Type string - Event type
- resource_
kind str - Resource kind
- event_
type str - Event type
- resource
Kind String - Resource kind
- event
Type String - Event type
ClusterAlertRuleMetricRule, ClusterAlertRuleMetricRuleArgs
- Duration string
- Metric rule duration
- Expression string
- Metric rule expression
- Threshold
Value 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
- Threshold
Value 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
- threshold
Value 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
- threshold
Value 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
- threshold
Value Number - Metric rule threshold value
- comparison String
- Metric rule comparison
- description String
- Metric rule description
ClusterAlertRuleNodeRule, ClusterAlertRuleNodeRuleArgs
- Condition string
- Node rule condition
- Cpu
Threshold int - Node rule cpu threshold
- Mem
Threshold int - Node rule mem threshold
- Node
Id string - Node ID
- Selector Dictionary<string, object>
- Node rule selector
- Condition string
- Node rule condition
- Cpu
Threshold int - Node rule cpu threshold
- Mem
Threshold int - Node rule mem threshold
- Node
Id string - Node ID
- Selector map[string]interface{}
- Node rule selector
- condition String
- Node rule condition
- cpu
Threshold Integer - Node rule cpu threshold
- mem
Threshold Integer - Node rule mem threshold
- node
Id String - Node ID
- selector Map<String,Object>
- Node rule selector
- condition string
- Node rule condition
- cpu
Threshold number - Node rule cpu threshold
- mem
Threshold number - Node rule mem threshold
- node
Id 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
- cpu
Threshold Number - Node rule cpu threshold
- mem
Threshold Number - Node rule mem threshold
- node
Id 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 <CLUSTER_ALERT_RULE_ID>
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.