grafana logo
Grafana v0.0.10, May 21 23

grafana.RuleGroup

Explore with Pulumi AI

Manages Grafana Alerting rule groups.

This resource requires Grafana 9.1.0 or later.

Example Usage

using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Grafana = Lbrlabs.PulumiPackage.Grafana;

return await Deployment.RunAsync(() => 
{
    var ruleFolder = new Grafana.Folder("ruleFolder", new()
    {
        Title = "My Alert Rule Folder",
    });

    var myAlertRule = new Grafana.RuleGroup("myAlertRule", new()
    {
        FolderUid = ruleFolder.Uid,
        IntervalSeconds = 240,
        OrgId = "1",
        Rules = new[]
        {
            new Grafana.Inputs.RuleGroupRuleArgs
            {
                Name = "My Alert Rule 1",
                For = "2m",
                Condition = "B",
                NoDataState = "NoData",
                ExecErrState = "Alerting",
                Annotations = 
                {
                    { "a", "b" },
                    { "c", "d" },
                },
                Labels = 
                {
                    { "e", "f" },
                    { "g", "h" },
                },
                IsPaused = false,
                Datas = new[]
                {
                    new Grafana.Inputs.RuleGroupRuleDataArgs
                    {
                        RefId = "A",
                        QueryType = "",
                        RelativeTimeRange = new Grafana.Inputs.RuleGroupRuleDataRelativeTimeRangeArgs
                        {
                            From = 600,
                            To = 0,
                        },
                        DatasourceUid = "PD8C576611E62080A",
                        Model = JsonSerializer.Serialize(new Dictionary<string, object?>
                        {
                            ["hide"] = false,
                            ["intervalMs"] = 1000,
                            ["maxDataPoints"] = 43200,
                            ["refId"] = "A",
                        }),
                    },
                    new Grafana.Inputs.RuleGroupRuleDataArgs
                    {
                        RefId = "B",
                        QueryType = "",
                        RelativeTimeRange = new Grafana.Inputs.RuleGroupRuleDataRelativeTimeRangeArgs
                        {
                            From = 0,
                            To = 0,
                        },
                        DatasourceUid = "-100",
                        Model = @"{
    ""conditions"": [
        {
        ""evaluator"": {
            ""params"": [
            3
            ],
            ""type"": ""gt""
        },
        ""operator"": {
            ""type"": ""and""
        },
        ""query"": {
            ""params"": [
            ""A""
            ]
        },
        ""reducer"": {
            ""params"": [],
            ""type"": ""last""
        },
        ""type"": ""query""
        }
    ],
    ""datasource"": {
        ""type"": ""__expr__"",
        ""uid"": ""-100""
    },
    ""hide"": false,
    ""intervalMs"": 1000,
    ""maxDataPoints"": 43200,
    ""refId"": ""B"",
    ""type"": ""classic_conditions""
}
",
                    },
                },
            },
        },
    });

});
package main

import (
	"encoding/json"

	"github.com/lbrlabs/pulumi-grafana/sdk/go/grafana"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		ruleFolder, err := grafana.NewFolder(ctx, "ruleFolder", &grafana.FolderArgs{
			Title: pulumi.String("My Alert Rule Folder"),
		})
		if err != nil {
			return err
		}
		tmpJSON0, err := json.Marshal(map[string]interface{}{
			"hide":          false,
			"intervalMs":    1000,
			"maxDataPoints": 43200,
			"refId":         "A",
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		_, err = grafana.NewRuleGroup(ctx, "myAlertRule", &grafana.RuleGroupArgs{
			FolderUid:       ruleFolder.Uid,
			IntervalSeconds: pulumi.Int(240),
			OrgId:           pulumi.String("1"),
			Rules: grafana.RuleGroupRuleArray{
				&grafana.RuleGroupRuleArgs{
					Name:         pulumi.String("My Alert Rule 1"),
					For:          pulumi.String("2m"),
					Condition:    pulumi.String("B"),
					NoDataState:  pulumi.String("NoData"),
					ExecErrState: pulumi.String("Alerting"),
					Annotations: pulumi.StringMap{
						"a": pulumi.String("b"),
						"c": pulumi.String("d"),
					},
					Labels: pulumi.StringMap{
						"e": pulumi.String("f"),
						"g": pulumi.String("h"),
					},
					IsPaused: pulumi.Bool(false),
					Datas: grafana.RuleGroupRuleDataArray{
						&grafana.RuleGroupRuleDataArgs{
							RefId:     pulumi.String("A"),
							QueryType: pulumi.String(""),
							RelativeTimeRange: &grafana.RuleGroupRuleDataRelativeTimeRangeArgs{
								From: pulumi.Int(600),
								To:   pulumi.Int(0),
							},
							DatasourceUid: pulumi.String("PD8C576611E62080A"),
							Model:         pulumi.String(json0),
						},
						&grafana.RuleGroupRuleDataArgs{
							RefId:     pulumi.String("B"),
							QueryType: pulumi.String(""),
							RelativeTimeRange: &grafana.RuleGroupRuleDataRelativeTimeRangeArgs{
								From: pulumi.Int(0),
								To:   pulumi.Int(0),
							},
							DatasourceUid: pulumi.String("-100"),
							Model:         pulumi.String("{\n    \"conditions\": [\n        {\n        \"evaluator\": {\n            \"params\": [\n            3\n            ],\n            \"type\": \"gt\"\n        },\n        \"operator\": {\n            \"type\": \"and\"\n        },\n        \"query\": {\n            \"params\": [\n            \"A\"\n            ]\n        },\n        \"reducer\": {\n            \"params\": [],\n            \"type\": \"last\"\n        },\n        \"type\": \"query\"\n        }\n    ],\n    \"datasource\": {\n        \"type\": \"__expr__\",\n        \"uid\": \"-100\"\n    },\n    \"hide\": false,\n    \"intervalMs\": 1000,\n    \"maxDataPoints\": 43200,\n    \"refId\": \"B\",\n    \"type\": \"classic_conditions\"\n}\n"),
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.Folder;
import com.pulumi.grafana.FolderArgs;
import com.pulumi.grafana.RuleGroup;
import com.pulumi.grafana.RuleGroupArgs;
import com.pulumi.grafana.inputs.RuleGroupRuleArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var ruleFolder = new Folder("ruleFolder", FolderArgs.builder()        
            .title("My Alert Rule Folder")
            .build());

        var myAlertRule = new RuleGroup("myAlertRule", RuleGroupArgs.builder()        
            .folderUid(ruleFolder.uid())
            .intervalSeconds(240)
            .orgId(1)
            .rules(RuleGroupRuleArgs.builder()
                .name("My Alert Rule 1")
                .for_("2m")
                .condition("B")
                .noDataState("NoData")
                .execErrState("Alerting")
                .annotations(Map.ofEntries(
                    Map.entry("a", "b"),
                    Map.entry("c", "d")
                ))
                .labels(Map.ofEntries(
                    Map.entry("e", "f"),
                    Map.entry("g", "h")
                ))
                .isPaused(false)
                .datas(                
                    RuleGroupRuleDataArgs.builder()
                        .refId("A")
                        .queryType("")
                        .relativeTimeRange(RuleGroupRuleDataRelativeTimeRangeArgs.builder()
                            .from(600)
                            .to(0)
                            .build())
                        .datasourceUid("PD8C576611E62080A")
                        .model(serializeJson(
                            jsonObject(
                                jsonProperty("hide", false),
                                jsonProperty("intervalMs", 1000),
                                jsonProperty("maxDataPoints", 43200),
                                jsonProperty("refId", "A")
                            )))
                        .build(),
                    RuleGroupRuleDataArgs.builder()
                        .refId("B")
                        .queryType("")
                        .relativeTimeRange(RuleGroupRuleDataRelativeTimeRangeArgs.builder()
                            .from(0)
                            .to(0)
                            .build())
                        .datasourceUid("-100")
                        .model("""
{
    "conditions": [
        {
        "evaluator": {
            "params": [
            3
            ],
            "type": "gt"
        },
        "operator": {
            "type": "and"
        },
        "query": {
            "params": [
            "A"
            ]
        },
        "reducer": {
            "params": [],
            "type": "last"
        },
        "type": "query"
        }
    ],
    "datasource": {
        "type": "__expr__",
        "uid": "-100"
    },
    "hide": false,
    "intervalMs": 1000,
    "maxDataPoints": 43200,
    "refId": "B",
    "type": "classic_conditions"
}
                        """)
                        .build())
                .build())
            .build());

    }
}
import pulumi
import json
import lbrlabs_pulumi_grafana as grafana

rule_folder = grafana.Folder("ruleFolder", title="My Alert Rule Folder")
my_alert_rule = grafana.RuleGroup("myAlertRule",
    folder_uid=rule_folder.uid,
    interval_seconds=240,
    org_id="1",
    rules=[grafana.RuleGroupRuleArgs(
        name="My Alert Rule 1",
        for_="2m",
        condition="B",
        no_data_state="NoData",
        exec_err_state="Alerting",
        annotations={
            "a": "b",
            "c": "d",
        },
        labels={
            "e": "f",
            "g": "h",
        },
        is_paused=False,
        datas=[
            grafana.RuleGroupRuleDataArgs(
                ref_id="A",
                query_type="",
                relative_time_range=grafana.RuleGroupRuleDataRelativeTimeRangeArgs(
                    from_=600,
                    to=0,
                ),
                datasource_uid="PD8C576611E62080A",
                model=json.dumps({
                    "hide": False,
                    "intervalMs": 1000,
                    "maxDataPoints": 43200,
                    "refId": "A",
                }),
            ),
            grafana.RuleGroupRuleDataArgs(
                ref_id="B",
                query_type="",
                relative_time_range=grafana.RuleGroupRuleDataRelativeTimeRangeArgs(
                    from_=0,
                    to=0,
                ),
                datasource_uid="-100",
                model="""{
    "conditions": [
        {
        "evaluator": {
            "params": [
            3
            ],
            "type": "gt"
        },
        "operator": {
            "type": "and"
        },
        "query": {
            "params": [
            "A"
            ]
        },
        "reducer": {
            "params": [],
            "type": "last"
        },
        "type": "query"
        }
    ],
    "datasource": {
        "type": "__expr__",
        "uid": "-100"
    },
    "hide": false,
    "intervalMs": 1000,
    "maxDataPoints": 43200,
    "refId": "B",
    "type": "classic_conditions"
}
""",
            ),
        ],
    )])
import * as pulumi from "@pulumi/pulumi";
import * as grafana from "@lbrlabs/pulumi-grafana";

const ruleFolder = new grafana.Folder("ruleFolder", {title: "My Alert Rule Folder"});
const myAlertRule = new grafana.RuleGroup("myAlertRule", {
    folderUid: ruleFolder.uid,
    intervalSeconds: 240,
    orgId: "1",
    rules: [{
        name: "My Alert Rule 1",
        "for": "2m",
        condition: "B",
        noDataState: "NoData",
        execErrState: "Alerting",
        annotations: {
            a: "b",
            c: "d",
        },
        labels: {
            e: "f",
            g: "h",
        },
        isPaused: false,
        datas: [
            {
                refId: "A",
                queryType: "",
                relativeTimeRange: {
                    from: 600,
                    to: 0,
                },
                datasourceUid: "PD8C576611E62080A",
                model: JSON.stringify({
                    hide: false,
                    intervalMs: 1000,
                    maxDataPoints: 43200,
                    refId: "A",
                }),
            },
            {
                refId: "B",
                queryType: "",
                relativeTimeRange: {
                    from: 0,
                    to: 0,
                },
                datasourceUid: "-100",
                model: `{
    "conditions": [
        {
        "evaluator": {
            "params": [
            3
            ],
            "type": "gt"
        },
        "operator": {
            "type": "and"
        },
        "query": {
            "params": [
            "A"
            ]
        },
        "reducer": {
            "params": [],
            "type": "last"
        },
        "type": "query"
        }
    ],
    "datasource": {
        "type": "__expr__",
        "uid": "-100"
    },
    "hide": false,
    "intervalMs": 1000,
    "maxDataPoints": 43200,
    "refId": "B",
    "type": "classic_conditions"
}
`,
            },
        ],
    }],
});
resources:
  ruleFolder:
    type: grafana:Folder
    properties:
      title: My Alert Rule Folder
  myAlertRule:
    type: grafana:RuleGroup
    properties:
      folderUid: ${ruleFolder.uid}
      intervalSeconds: 240
      orgId: 1
      rules:
        - name: My Alert Rule 1
          for: 2m
          condition: B
          noDataState: NoData
          execErrState: Alerting
          annotations:
            a: b
            c: d
          labels:
            e: f
            g: h
          isPaused: false
          datas:
            - refId: A
              queryType:
              relativeTimeRange:
                from: 600
                to: 0
              datasourceUid: PD8C576611E62080A
              model:
                fn::toJSON:
                  hide: false
                  intervalMs: 1000
                  maxDataPoints: 43200
                  refId: A
            - refId: B
              queryType:
              relativeTimeRange:
                from: 0
                to: 0
              datasourceUid: '-100'
              model: |
                {
                    "conditions": [
                        {
                        "evaluator": {
                            "params": [
                            3
                            ],
                            "type": "gt"
                        },
                        "operator": {
                            "type": "and"
                        },
                        "query": {
                            "params": [
                            "A"
                            ]
                        },
                        "reducer": {
                            "params": [],
                            "type": "last"
                        },
                        "type": "query"
                        }
                    ],
                    "datasource": {
                        "type": "__expr__",
                        "uid": "-100"
                    },
                    "hide": false,
                    "intervalMs": 1000,
                    "maxDataPoints": 43200,
                    "refId": "B",
                    "type": "classic_conditions"
                }                

Create RuleGroup Resource

new RuleGroup(name: string, args: RuleGroupArgs, opts?: CustomResourceOptions);
@overload
def RuleGroup(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              folder_uid: Optional[str] = None,
              interval_seconds: Optional[int] = None,
              name: Optional[str] = None,
              org_id: Optional[str] = None,
              rules: Optional[Sequence[RuleGroupRuleArgs]] = None)
@overload
def RuleGroup(resource_name: str,
              args: RuleGroupArgs,
              opts: Optional[ResourceOptions] = None)
func NewRuleGroup(ctx *Context, name string, args RuleGroupArgs, opts ...ResourceOption) (*RuleGroup, error)
public RuleGroup(string name, RuleGroupArgs args, CustomResourceOptions? opts = null)
public RuleGroup(String name, RuleGroupArgs args)
public RuleGroup(String name, RuleGroupArgs args, CustomResourceOptions options)
type: grafana:RuleGroup
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args RuleGroupArgs
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 RuleGroupArgs
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 RuleGroupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args RuleGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args RuleGroupArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

FolderUid string

The UID of the folder that the group belongs to.

IntervalSeconds int

The interval, in seconds, at which all rules in the group are evaluated. If a group contains many rules, the rules are evaluated sequentially.

OrgId string

The ID of the org to which the group belongs.

Rules List<Lbrlabs.PulumiPackage.Grafana.Inputs.RuleGroupRuleArgs>

The rules within the group.

Name string

The name of the rule group.

FolderUid string

The UID of the folder that the group belongs to.

IntervalSeconds int

The interval, in seconds, at which all rules in the group are evaluated. If a group contains many rules, the rules are evaluated sequentially.

OrgId string

The ID of the org to which the group belongs.

Rules []RuleGroupRuleArgs

The rules within the group.

Name string

The name of the rule group.

folderUid String

The UID of the folder that the group belongs to.

intervalSeconds Integer

The interval, in seconds, at which all rules in the group are evaluated. If a group contains many rules, the rules are evaluated sequentially.

orgId String

The ID of the org to which the group belongs.

rules List<RuleGroupRuleArgs>

The rules within the group.

name String

The name of the rule group.

folderUid string

The UID of the folder that the group belongs to.

intervalSeconds number

The interval, in seconds, at which all rules in the group are evaluated. If a group contains many rules, the rules are evaluated sequentially.

orgId string

The ID of the org to which the group belongs.

rules RuleGroupRuleArgs[]

The rules within the group.

name string

The name of the rule group.

folder_uid str

The UID of the folder that the group belongs to.

interval_seconds int

The interval, in seconds, at which all rules in the group are evaluated. If a group contains many rules, the rules are evaluated sequentially.

org_id str

The ID of the org to which the group belongs.

rules Sequence[RuleGroupRuleArgs]

The rules within the group.

name str

The name of the rule group.

folderUid String

The UID of the folder that the group belongs to.

intervalSeconds Number

The interval, in seconds, at which all rules in the group are evaluated. If a group contains many rules, the rules are evaluated sequentially.

orgId String

The ID of the org to which the group belongs.

rules List<Property Map>

The rules within the group.

name String

The name of the rule group.

Outputs

All input properties are implicitly available as output properties. Additionally, the RuleGroup 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 RuleGroup Resource

Get an existing RuleGroup 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?: RuleGroupState, opts?: CustomResourceOptions): RuleGroup
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        folder_uid: Optional[str] = None,
        interval_seconds: Optional[int] = None,
        name: Optional[str] = None,
        org_id: Optional[str] = None,
        rules: Optional[Sequence[RuleGroupRuleArgs]] = None) -> RuleGroup
func GetRuleGroup(ctx *Context, name string, id IDInput, state *RuleGroupState, opts ...ResourceOption) (*RuleGroup, error)
public static RuleGroup Get(string name, Input<string> id, RuleGroupState? state, CustomResourceOptions? opts = null)
public static RuleGroup get(String name, Output<String> id, RuleGroupState 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:
FolderUid string

The UID of the folder that the group belongs to.

IntervalSeconds int

The interval, in seconds, at which all rules in the group are evaluated. If a group contains many rules, the rules are evaluated sequentially.

Name string

The name of the rule group.

OrgId string

The ID of the org to which the group belongs.

Rules List<Lbrlabs.PulumiPackage.Grafana.Inputs.RuleGroupRuleArgs>

The rules within the group.

FolderUid string

The UID of the folder that the group belongs to.

IntervalSeconds int

The interval, in seconds, at which all rules in the group are evaluated. If a group contains many rules, the rules are evaluated sequentially.

Name string

The name of the rule group.

OrgId string

The ID of the org to which the group belongs.

Rules []RuleGroupRuleArgs

The rules within the group.

folderUid String

The UID of the folder that the group belongs to.

intervalSeconds Integer

The interval, in seconds, at which all rules in the group are evaluated. If a group contains many rules, the rules are evaluated sequentially.

name String

The name of the rule group.

orgId String

The ID of the org to which the group belongs.

rules List<RuleGroupRuleArgs>

The rules within the group.

folderUid string

The UID of the folder that the group belongs to.

intervalSeconds number

The interval, in seconds, at which all rules in the group are evaluated. If a group contains many rules, the rules are evaluated sequentially.

name string

The name of the rule group.

orgId string

The ID of the org to which the group belongs.

rules RuleGroupRuleArgs[]

The rules within the group.

folder_uid str

The UID of the folder that the group belongs to.

interval_seconds int

The interval, in seconds, at which all rules in the group are evaluated. If a group contains many rules, the rules are evaluated sequentially.

name str

The name of the rule group.

org_id str

The ID of the org to which the group belongs.

rules Sequence[RuleGroupRuleArgs]

The rules within the group.

folderUid String

The UID of the folder that the group belongs to.

intervalSeconds Number

The interval, in seconds, at which all rules in the group are evaluated. If a group contains many rules, the rules are evaluated sequentially.

name String

The name of the rule group.

orgId String

The ID of the org to which the group belongs.

rules List<Property Map>

The rules within the group.

Supporting Types

RuleGroupRule

Condition string

The ref_id of the query node in the data field to use as the alert condition.

Datas List<Lbrlabs.PulumiPackage.Grafana.Inputs.RuleGroupRuleData>

A sequence of stages that describe the contents of the rule.

Name string

The name of the alert rule.

Annotations Dictionary<string, string>

Key-value pairs of metadata to attach to the alert rule that may add user-defined context, but cannot be used for matching, grouping, or routing. Defaults to map[].

ExecErrState string

Describes what state to enter when the rule's query is invalid and the rule cannot be executed. Options are OK, Error, and Alerting. Defaults to Alerting.

For string

The amount of time for which the rule must be breached for the rule to be considered to be Firing. Before this time has elapsed, the rule is only considered to be Pending. Defaults to 0.

IsPaused bool

Sets whether the alert should be paused or not. Defaults to false.

Labels Dictionary<string, string>

Key-value pairs to attach to the alert rule that can be used in matching, grouping, and routing. Defaults to map[].

NoDataState string

Describes what state to enter when the rule's query returns No Data. Options are OK, NoData, and Alerting. Defaults to NoData.

Uid string

The unique identifier of the alert rule.

Condition string

The ref_id of the query node in the data field to use as the alert condition.

Datas []RuleGroupRuleData

A sequence of stages that describe the contents of the rule.

Name string

The name of the alert rule.

Annotations map[string]string

Key-value pairs of metadata to attach to the alert rule that may add user-defined context, but cannot be used for matching, grouping, or routing. Defaults to map[].

ExecErrState string

Describes what state to enter when the rule's query is invalid and the rule cannot be executed. Options are OK, Error, and Alerting. Defaults to Alerting.

For string

The amount of time for which the rule must be breached for the rule to be considered to be Firing. Before this time has elapsed, the rule is only considered to be Pending. Defaults to 0.

IsPaused bool

Sets whether the alert should be paused or not. Defaults to false.

Labels map[string]string

Key-value pairs to attach to the alert rule that can be used in matching, grouping, and routing. Defaults to map[].

NoDataState string

Describes what state to enter when the rule's query returns No Data. Options are OK, NoData, and Alerting. Defaults to NoData.

Uid string

The unique identifier of the alert rule.

condition String

The ref_id of the query node in the data field to use as the alert condition.

datas List<RuleGroupRuleData>

A sequence of stages that describe the contents of the rule.

name String

The name of the alert rule.

annotations Map<String,String>

Key-value pairs of metadata to attach to the alert rule that may add user-defined context, but cannot be used for matching, grouping, or routing. Defaults to map[].

execErrState String

Describes what state to enter when the rule's query is invalid and the rule cannot be executed. Options are OK, Error, and Alerting. Defaults to Alerting.

for_ String

The amount of time for which the rule must be breached for the rule to be considered to be Firing. Before this time has elapsed, the rule is only considered to be Pending. Defaults to 0.

isPaused Boolean

Sets whether the alert should be paused or not. Defaults to false.

labels Map<String,String>

Key-value pairs to attach to the alert rule that can be used in matching, grouping, and routing. Defaults to map[].

noDataState String

Describes what state to enter when the rule's query returns No Data. Options are OK, NoData, and Alerting. Defaults to NoData.

uid String

The unique identifier of the alert rule.

condition string

The ref_id of the query node in the data field to use as the alert condition.

datas RuleGroupRuleData[]

A sequence of stages that describe the contents of the rule.

name string

The name of the alert rule.

annotations {[key: string]: string}

Key-value pairs of metadata to attach to the alert rule that may add user-defined context, but cannot be used for matching, grouping, or routing. Defaults to map[].

execErrState string

Describes what state to enter when the rule's query is invalid and the rule cannot be executed. Options are OK, Error, and Alerting. Defaults to Alerting.

for string

The amount of time for which the rule must be breached for the rule to be considered to be Firing. Before this time has elapsed, the rule is only considered to be Pending. Defaults to 0.

isPaused boolean

Sets whether the alert should be paused or not. Defaults to false.

labels {[key: string]: string}

Key-value pairs to attach to the alert rule that can be used in matching, grouping, and routing. Defaults to map[].

noDataState string

Describes what state to enter when the rule's query returns No Data. Options are OK, NoData, and Alerting. Defaults to NoData.

uid string

The unique identifier of the alert rule.

condition str

The ref_id of the query node in the data field to use as the alert condition.

datas Sequence[RuleGroupRuleData]

A sequence of stages that describe the contents of the rule.

name str

The name of the alert rule.

annotations Mapping[str, str]

Key-value pairs of metadata to attach to the alert rule that may add user-defined context, but cannot be used for matching, grouping, or routing. Defaults to map[].

exec_err_state str

Describes what state to enter when the rule's query is invalid and the rule cannot be executed. Options are OK, Error, and Alerting. Defaults to Alerting.

for_ str

The amount of time for which the rule must be breached for the rule to be considered to be Firing. Before this time has elapsed, the rule is only considered to be Pending. Defaults to 0.

is_paused bool

Sets whether the alert should be paused or not. Defaults to false.

labels Mapping[str, str]

Key-value pairs to attach to the alert rule that can be used in matching, grouping, and routing. Defaults to map[].

no_data_state str

Describes what state to enter when the rule's query returns No Data. Options are OK, NoData, and Alerting. Defaults to NoData.

uid str

The unique identifier of the alert rule.

condition String

The ref_id of the query node in the data field to use as the alert condition.

datas List<Property Map>

A sequence of stages that describe the contents of the rule.

name String

The name of the alert rule.

annotations Map<String>

Key-value pairs of metadata to attach to the alert rule that may add user-defined context, but cannot be used for matching, grouping, or routing. Defaults to map[].

execErrState String

Describes what state to enter when the rule's query is invalid and the rule cannot be executed. Options are OK, Error, and Alerting. Defaults to Alerting.

for String

The amount of time for which the rule must be breached for the rule to be considered to be Firing. Before this time has elapsed, the rule is only considered to be Pending. Defaults to 0.

isPaused Boolean

Sets whether the alert should be paused or not. Defaults to false.

labels Map<String>

Key-value pairs to attach to the alert rule that can be used in matching, grouping, and routing. Defaults to map[].

noDataState String

Describes what state to enter when the rule's query returns No Data. Options are OK, NoData, and Alerting. Defaults to NoData.

uid String

The unique identifier of the alert rule.

RuleGroupRuleData

RuleGroupRuleDataRelativeTimeRange

From int
To int
From int
To int
from Integer
to Integer
from number
to number
from_ int
to int
from Number
to Number

Import

 $ pulumi import grafana:index/ruleGroup:RuleGroup rule_group_name {{folder_uid}};{{rule_group_name}}

Package Details

Repository
grafana lbrlabs/pulumi-grafana
License
Apache-2.0
Notes

This Pulumi package is based on the grafana Terraform Provider.