1. Packages
  2. Grafana Cloud
  3. API Docs
  4. alerting
  5. AlertRuleV0Alpha1
Grafana v2.15.0 published on Wednesday, Nov 12, 2025 by pulumiverse
grafana logo
Grafana v2.15.0 published on Wednesday, Nov 12, 2025 by pulumiverse

    Manages Grafana Alert Rules.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as grafana from "@pulumiverse/grafana";
    
    const alertruleFolder = new grafana.oss.Folder("alertrule_folder", {title: "Alert Rule Folder"});
    const example = new grafana.alerting.AlertRuleV0Alpha1("example", {
        metadata: {
            uid: "example-alert-rule",
            folderUid: alertruleFolder.uid,
        },
        spec: {
            title: "Example Alert Rule",
            trigger: {
                interval: "1m",
            },
            paused: true,
            expressions: {
                A: {
                    model: {
                        datasource: {
                            type: "prometheus",
                            uid: "ds_uid",
                        },
                        editorMode: "code",
                        expr: "count(up{})",
                        instant: true,
                        intervalMs: 1000,
                        legendFormat: "__auto",
                        maxDataPoints: 43200,
                        range: false,
                        refId: "A",
                    },
                    datasourceUid: "ds_uid",
                    relativeTimeRange: {
                        from: "600s",
                        to: "0s",
                    },
                    queryType: "",
                    source: true,
                },
                B: {
                    model: {
                        conditions: [{
                            evaluator: {
                                params: [1],
                                type: "gt",
                            },
                            operator: {
                                type: "and",
                            },
                            query: {
                                params: ["C"],
                            },
                            reducer: {
                                params: [],
                                type: "last",
                            },
                            type: "query",
                        }],
                        datasource: {
                            type: "__expr__",
                            uid: "__expr__",
                        },
                        expression: "A",
                        intervalMs: 1000,
                        maxDataPoints: 43200,
                        refId: "C",
                        type: "threshold",
                    },
                    datasourceUid: "__expr__",
                    queryType: "",
                    source: false,
                },
            },
            "for": "5m",
            labels: {
                severity: "critical",
            },
            annotations: {
                runbook_url: "https://example.com",
            },
            noDataState: "KeepLast",
            execErrState: "KeepLast",
            missingSeriesEvalsToResolve: 5,
            notificationSettings: {
                contactPoint: "grafana-default-email",
            },
        },
    });
    
    import pulumi
    import pulumiverse_grafana as grafana
    
    alertrule_folder = grafana.oss.Folder("alertrule_folder", title="Alert Rule Folder")
    example = grafana.alerting.AlertRuleV0Alpha1("example",
        metadata={
            "uid": "example-alert-rule",
            "folder_uid": alertrule_folder.uid,
        },
        spec={
            "title": "Example Alert Rule",
            "trigger": {
                "interval": "1m",
            },
            "paused": True,
            "expressions": {
                "A": {
                    "model": {
                        "datasource": {
                            "type": "prometheus",
                            "uid": "ds_uid",
                        },
                        "editorMode": "code",
                        "expr": "count(up{})",
                        "instant": True,
                        "intervalMs": 1000,
                        "legendFormat": "__auto",
                        "maxDataPoints": 43200,
                        "range": False,
                        "refId": "A",
                    },
                    "datasourceUid": "ds_uid",
                    "relativeTimeRange": {
                        "from": "600s",
                        "to": "0s",
                    },
                    "queryType": "",
                    "source": True,
                },
                "B": {
                    "model": {
                        "conditions": [{
                            "evaluator": {
                                "params": [1],
                                "type": "gt",
                            },
                            "operator": {
                                "type": "and",
                            },
                            "query": {
                                "params": ["C"],
                            },
                            "reducer": {
                                "params": [],
                                "type": "last",
                            },
                            "type": "query",
                        }],
                        "datasource": {
                            "type": "__expr__",
                            "uid": "__expr__",
                        },
                        "expression": "A",
                        "intervalMs": 1000,
                        "maxDataPoints": 43200,
                        "refId": "C",
                        "type": "threshold",
                    },
                    "datasourceUid": "__expr__",
                    "queryType": "",
                    "source": False,
                },
            },
            "for_": "5m",
            "labels": {
                "severity": "critical",
            },
            "annotations": {
                "runbook_url": "https://example.com",
            },
            "no_data_state": "KeepLast",
            "exec_err_state": "KeepLast",
            "missing_series_evals_to_resolve": 5,
            "notification_settings": {
                "contact_point": "grafana-default-email",
            },
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-grafana/sdk/v2/go/grafana/alerting"
    	"github.com/pulumiverse/pulumi-grafana/sdk/v2/go/grafana/oss"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		alertruleFolder, err := oss.NewFolder(ctx, "alertrule_folder", &oss.FolderArgs{
    			Title: pulumi.String("Alert Rule Folder"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = alerting.NewAlertRuleV0Alpha1(ctx, "example", &alerting.AlertRuleV0Alpha1Args{
    			Metadata: &alerting.AlertRuleV0Alpha1MetadataArgs{
    				Uid:       pulumi.String("example-alert-rule"),
    				FolderUid: alertruleFolder.Uid,
    			},
    			Spec: &alerting.AlertRuleV0Alpha1SpecArgs{
    				Title: pulumi.String("Example Alert Rule"),
    				Trigger: &alerting.AlertRuleV0Alpha1SpecTriggerArgs{
    					Interval: pulumi.String("1m"),
    				},
    				Paused: pulumi.Bool(true),
    				Expressions: pulumi.Any(map[string]interface{}{
    					"A": map[string]interface{}{
    						"model": map[string]interface{}{
    							"datasource": map[string]interface{}{
    								"type": "prometheus",
    								"uid":  "ds_uid",
    							},
    							"editorMode":    "code",
    							"expr":          "count(up{})",
    							"instant":       true,
    							"intervalMs":    1000,
    							"legendFormat":  "__auto",
    							"maxDataPoints": 43200,
    							"range":         false,
    							"refId":         "A",
    						},
    						"datasourceUid": "ds_uid",
    						"relativeTimeRange": map[string]interface{}{
    							"from": "600s",
    							"to":   "0s",
    						},
    						"queryType": "",
    						"source":    true,
    					},
    					"B": map[string]interface{}{
    						"model": map[string]interface{}{
    							"conditions": []map[string]interface{}{
    								map[string]interface{}{
    									"evaluator": map[string]interface{}{
    										"params": []float64{
    											1,
    										},
    										"type": "gt",
    									},
    									"operator": map[string]interface{}{
    										"type": "and",
    									},
    									"query": map[string]interface{}{
    										"params": []string{
    											"C",
    										},
    									},
    									"reducer": map[string]interface{}{
    										"params": []interface{}{},
    										"type":   "last",
    									},
    									"type": "query",
    								},
    							},
    							"datasource": map[string]interface{}{
    								"type": "__expr__",
    								"uid":  "__expr__",
    							},
    							"expression":    "A",
    							"intervalMs":    1000,
    							"maxDataPoints": 43200,
    							"refId":         "C",
    							"type":          "threshold",
    						},
    						"datasourceUid": "__expr__",
    						"queryType":     "",
    						"source":        false,
    					},
    				}),
    				For: pulumi.String("5m"),
    				Labels: pulumi.StringMap{
    					"severity": pulumi.String("critical"),
    				},
    				Annotations: pulumi.StringMap{
    					"runbook_url": pulumi.String("https://example.com"),
    				},
    				NoDataState:                 pulumi.String("KeepLast"),
    				ExecErrState:                pulumi.String("KeepLast"),
    				MissingSeriesEvalsToResolve: pulumi.Int(5),
    				NotificationSettings: &alerting.AlertRuleV0Alpha1SpecNotificationSettingsArgs{
    					ContactPoint: pulumi.String("grafana-default-email"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Grafana = Pulumiverse.Grafana;
    
    return await Deployment.RunAsync(() => 
    {
        var alertruleFolder = new Grafana.Oss.Folder("alertrule_folder", new()
        {
            Title = "Alert Rule Folder",
        });
    
        var example = new Grafana.Alerting.AlertRuleV0Alpha1("example", new()
        {
            Metadata = new Grafana.Alerting.Inputs.AlertRuleV0Alpha1MetadataArgs
            {
                Uid = "example-alert-rule",
                FolderUid = alertruleFolder.Uid,
            },
            Spec = new Grafana.Alerting.Inputs.AlertRuleV0Alpha1SpecArgs
            {
                Title = "Example Alert Rule",
                Trigger = new Grafana.Alerting.Inputs.AlertRuleV0Alpha1SpecTriggerArgs
                {
                    Interval = "1m",
                },
                Paused = true,
                Expressions = new Dictionary<string, object?>
                {
                    ["A"] = new Dictionary<string, object?>
                    {
                        ["model"] = new Dictionary<string, object?>
                        {
                            ["datasource"] = new Dictionary<string, object?>
                            {
                                ["type"] = "prometheus",
                                ["uid"] = "ds_uid",
                            },
                            ["editorMode"] = "code",
                            ["expr"] = "count(up{})",
                            ["instant"] = true,
                            ["intervalMs"] = 1000,
                            ["legendFormat"] = "__auto",
                            ["maxDataPoints"] = 43200,
                            ["range"] = false,
                            ["refId"] = "A",
                        },
                        ["datasourceUid"] = "ds_uid",
                        ["relativeTimeRange"] = new Dictionary<string, object?>
                        {
                            ["from"] = "600s",
                            ["to"] = "0s",
                        },
                        ["queryType"] = "",
                        ["source"] = true,
                    },
                    ["B"] = new Dictionary<string, object?>
                    {
                        ["model"] = new Dictionary<string, object?>
                        {
                            ["conditions"] = new[]
                            {
                                new Dictionary<string, object?>
                                {
                                    ["evaluator"] = new Dictionary<string, object?>
                                    {
                                        ["params"] = new[]
                                        {
                                            1,
                                        },
                                        ["type"] = "gt",
                                    },
                                    ["operator"] = new Dictionary<string, object?>
                                    {
                                        ["type"] = "and",
                                    },
                                    ["query"] = new Dictionary<string, object?>
                                    {
                                        ["params"] = new[]
                                        {
                                            "C",
                                        },
                                    },
                                    ["reducer"] = new Dictionary<string, object?>
                                    {
                                        ["params"] = new[]
                                        {
                                        },
                                        ["type"] = "last",
                                    },
                                    ["type"] = "query",
                                },
                            },
                            ["datasource"] = new Dictionary<string, object?>
                            {
                                ["type"] = "__expr__",
                                ["uid"] = "__expr__",
                            },
                            ["expression"] = "A",
                            ["intervalMs"] = 1000,
                            ["maxDataPoints"] = 43200,
                            ["refId"] = "C",
                            ["type"] = "threshold",
                        },
                        ["datasourceUid"] = "__expr__",
                        ["queryType"] = "",
                        ["source"] = false,
                    },
                },
                For = "5m",
                Labels = 
                {
                    { "severity", "critical" },
                },
                Annotations = 
                {
                    { "runbook_url", "https://example.com" },
                },
                NoDataState = "KeepLast",
                ExecErrState = "KeepLast",
                MissingSeriesEvalsToResolve = 5,
                NotificationSettings = new Grafana.Alerting.Inputs.AlertRuleV0Alpha1SpecNotificationSettingsArgs
                {
                    ContactPoint = "grafana-default-email",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.grafana.oss.Folder;
    import com.pulumi.grafana.oss.FolderArgs;
    import com.pulumi.grafana.alerting.AlertRuleV0Alpha1;
    import com.pulumi.grafana.alerting.AlertRuleV0Alpha1Args;
    import com.pulumi.grafana.alerting.inputs.AlertRuleV0Alpha1MetadataArgs;
    import com.pulumi.grafana.alerting.inputs.AlertRuleV0Alpha1SpecArgs;
    import com.pulumi.grafana.alerting.inputs.AlertRuleV0Alpha1SpecTriggerArgs;
    import com.pulumi.grafana.alerting.inputs.AlertRuleV0Alpha1SpecNotificationSettingsArgs;
    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 alertruleFolder = new Folder("alertruleFolder", FolderArgs.builder()
                .title("Alert Rule Folder")
                .build());
    
            var example = new AlertRuleV0Alpha1("example", AlertRuleV0Alpha1Args.builder()
                .metadata(AlertRuleV0Alpha1MetadataArgs.builder()
                    .uid("example-alert-rule")
                    .folderUid(alertruleFolder.uid())
                    .build())
                .spec(AlertRuleV0Alpha1SpecArgs.builder()
                    .title("Example Alert Rule")
                    .trigger(AlertRuleV0Alpha1SpecTriggerArgs.builder()
                        .interval("1m")
                        .build())
                    .paused(true)
                    .expressions(Map.ofEntries(
                        Map.entry("A", Map.ofEntries(
                            Map.entry("model", Map.ofEntries(
                                Map.entry("datasource", Map.ofEntries(
                                    Map.entry("type", "prometheus"),
                                    Map.entry("uid", "ds_uid")
                                )),
                                Map.entry("editorMode", "code"),
                                Map.entry("expr", "count(up{})"),
                                Map.entry("instant", true),
                                Map.entry("intervalMs", 1000),
                                Map.entry("legendFormat", "__auto"),
                                Map.entry("maxDataPoints", 43200),
                                Map.entry("range", false),
                                Map.entry("refId", "A")
                            )),
                            Map.entry("datasourceUid", "ds_uid"),
                            Map.entry("relativeTimeRange", Map.ofEntries(
                                Map.entry("from", "600s"),
                                Map.entry("to", "0s")
                            )),
                            Map.entry("queryType", ""),
                            Map.entry("source", true)
                        )),
                        Map.entry("B", Map.ofEntries(
                            Map.entry("model", Map.ofEntries(
                                Map.entry("conditions", Map.ofEntries(
                                    Map.entry("evaluator", Map.ofEntries(
                                        Map.entry("params", 1),
                                        Map.entry("type", "gt")
                                    )),
                                    Map.entry("operator", Map.of("type", "and")),
                                    Map.entry("query", Map.of("params", "C")),
                                    Map.entry("reducer", Map.ofEntries(
                                        Map.entry("params", ),
                                        Map.entry("type", "last")
                                    )),
                                    Map.entry("type", "query")
                                )),
                                Map.entry("datasource", Map.ofEntries(
                                    Map.entry("type", "__expr__"),
                                    Map.entry("uid", "__expr__")
                                )),
                                Map.entry("expression", "A"),
                                Map.entry("intervalMs", 1000),
                                Map.entry("maxDataPoints", 43200),
                                Map.entry("refId", "C"),
                                Map.entry("type", "threshold")
                            )),
                            Map.entry("datasourceUid", "__expr__"),
                            Map.entry("queryType", ""),
                            Map.entry("source", false)
                        ))
                    ))
                    .for_("5m")
                    .labels(Map.of("severity", "critical"))
                    .annotations(Map.of("runbook_url", "https://example.com"))
                    .noDataState("KeepLast")
                    .execErrState("KeepLast")
                    .missingSeriesEvalsToResolve(5)
                    .notificationSettings(AlertRuleV0Alpha1SpecNotificationSettingsArgs.builder()
                        .contactPoint("grafana-default-email")
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      alertruleFolder:
        type: grafana:oss:Folder
        name: alertrule_folder
        properties:
          title: Alert Rule Folder
      example:
        type: grafana:alerting:AlertRuleV0Alpha1
        properties:
          metadata:
            uid: example-alert-rule
            folderUid: ${alertruleFolder.uid}
          spec:
            title: Example Alert Rule
            trigger:
              interval: 1m
            paused: true
            expressions:
              A:
                model:
                  datasource:
                    type: prometheus
                    uid: ds_uid
                  editorMode: code
                  expr: count(up{})
                  instant: true
                  intervalMs: 1000
                  legendFormat: __auto
                  maxDataPoints: 43200
                  range: false
                  refId: A
                datasourceUid: ds_uid
                relativeTimeRange:
                  from: 600s
                  to: 0s
                queryType: ""
                source: true
              B:
                model:
                  conditions:
                    - evaluator:
                        params:
                          - 1
                        type: gt
                      operator:
                        type: and
                      query:
                        params:
                          - C
                      reducer:
                        params: []
                        type: last
                      type: query
                  datasource:
                    type: __expr__
                    uid: __expr__
                  expression: A
                  intervalMs: 1000
                  maxDataPoints: 43200
                  refId: C
                  type: threshold
                datasourceUid: __expr__
                queryType: ""
                source: false
            for: 5m
            labels:
              severity: critical
            annotations:
              runbook_url: https://example.com
            noDataState: KeepLast
            execErrState: KeepLast
            missingSeriesEvalsToResolve: 5
            notificationSettings:
              contactPoint: grafana-default-email
    

    Create AlertRuleV0Alpha1 Resource

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

    Constructor syntax

    new AlertRuleV0Alpha1(name: string, args?: AlertRuleV0Alpha1Args, opts?: CustomResourceOptions);
    @overload
    def AlertRuleV0Alpha1(resource_name: str,
                          args: Optional[AlertRuleV0Alpha1Args] = None,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def AlertRuleV0Alpha1(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          metadata: Optional[AlertRuleV0Alpha1MetadataArgs] = None,
                          options: Optional[AlertRuleV0Alpha1OptionsArgs] = None,
                          spec: Optional[AlertRuleV0Alpha1SpecArgs] = None)
    func NewAlertRuleV0Alpha1(ctx *Context, name string, args *AlertRuleV0Alpha1Args, opts ...ResourceOption) (*AlertRuleV0Alpha1, error)
    public AlertRuleV0Alpha1(string name, AlertRuleV0Alpha1Args? args = null, CustomResourceOptions? opts = null)
    public AlertRuleV0Alpha1(String name, AlertRuleV0Alpha1Args args)
    public AlertRuleV0Alpha1(String name, AlertRuleV0Alpha1Args args, CustomResourceOptions options)
    
    type: grafana:alerting:AlertRuleV0Alpha1
    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 AlertRuleV0Alpha1Args
    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 AlertRuleV0Alpha1Args
    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 AlertRuleV0Alpha1Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AlertRuleV0Alpha1Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AlertRuleV0Alpha1Args
    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 alertRuleV0Alpha1Resource = new Grafana.Alerting.AlertRuleV0Alpha1("alertRuleV0Alpha1Resource", new()
    {
        Metadata = new Grafana.Alerting.Inputs.AlertRuleV0Alpha1MetadataArgs
        {
            Uid = "string",
            Annotations = 
            {
                { "string", "string" },
            },
            FolderUid = "string",
            Url = "string",
            Uuid = "string",
            Version = "string",
        },
        Options = new Grafana.Alerting.Inputs.AlertRuleV0Alpha1OptionsArgs
        {
            Overwrite = false,
        },
        Spec = new Grafana.Alerting.Inputs.AlertRuleV0Alpha1SpecArgs
        {
            NoDataState = "string",
            ExecErrState = "string",
            Expressions = "any",
            Title = "string",
            MissingSeriesEvalsToResolve = 0,
            Labels = 
            {
                { "string", "string" },
            },
            Annotations = 
            {
                { "string", "string" },
            },
            KeepFiringFor = "string",
            NotificationSettings = new Grafana.Alerting.Inputs.AlertRuleV0Alpha1SpecNotificationSettingsArgs
            {
                ContactPoint = "string",
                ActiveTimings = new[]
                {
                    "string",
                },
                GroupBies = new[]
                {
                    "string",
                },
                GroupInterval = "string",
                GroupWait = "string",
                MuteTimings = new[]
                {
                    "string",
                },
                RepeatInterval = "string",
            },
            PanelRef = "any",
            Paused = false,
            For = "string",
            Trigger = new Grafana.Alerting.Inputs.AlertRuleV0Alpha1SpecTriggerArgs
            {
                Interval = "string",
            },
        },
    });
    
    example, err := alerting.NewAlertRuleV0Alpha1(ctx, "alertRuleV0Alpha1Resource", &alerting.AlertRuleV0Alpha1Args{
    	Metadata: &alerting.AlertRuleV0Alpha1MetadataArgs{
    		Uid: pulumi.String("string"),
    		Annotations: pulumi.StringMap{
    			"string": pulumi.String("string"),
    		},
    		FolderUid: pulumi.String("string"),
    		Url:       pulumi.String("string"),
    		Uuid:      pulumi.String("string"),
    		Version:   pulumi.String("string"),
    	},
    	Options: &alerting.AlertRuleV0Alpha1OptionsArgs{
    		Overwrite: pulumi.Bool(false),
    	},
    	Spec: &alerting.AlertRuleV0Alpha1SpecArgs{
    		NoDataState:                 pulumi.String("string"),
    		ExecErrState:                pulumi.String("string"),
    		Expressions:                 pulumi.Any("any"),
    		Title:                       pulumi.String("string"),
    		MissingSeriesEvalsToResolve: pulumi.Int(0),
    		Labels: pulumi.StringMap{
    			"string": pulumi.String("string"),
    		},
    		Annotations: pulumi.StringMap{
    			"string": pulumi.String("string"),
    		},
    		KeepFiringFor: pulumi.String("string"),
    		NotificationSettings: &alerting.AlertRuleV0Alpha1SpecNotificationSettingsArgs{
    			ContactPoint: pulumi.String("string"),
    			ActiveTimings: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			GroupBies: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			GroupInterval: pulumi.String("string"),
    			GroupWait:     pulumi.String("string"),
    			MuteTimings: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			RepeatInterval: pulumi.String("string"),
    		},
    		PanelRef: pulumi.Any("any"),
    		Paused:   pulumi.Bool(false),
    		For:      pulumi.String("string"),
    		Trigger: &alerting.AlertRuleV0Alpha1SpecTriggerArgs{
    			Interval: pulumi.String("string"),
    		},
    	},
    })
    
    var alertRuleV0Alpha1Resource = new AlertRuleV0Alpha1("alertRuleV0Alpha1Resource", AlertRuleV0Alpha1Args.builder()
        .metadata(AlertRuleV0Alpha1MetadataArgs.builder()
            .uid("string")
            .annotations(Map.of("string", "string"))
            .folderUid("string")
            .url("string")
            .uuid("string")
            .version("string")
            .build())
        .options(AlertRuleV0Alpha1OptionsArgs.builder()
            .overwrite(false)
            .build())
        .spec(AlertRuleV0Alpha1SpecArgs.builder()
            .noDataState("string")
            .execErrState("string")
            .expressions("any")
            .title("string")
            .missingSeriesEvalsToResolve(0)
            .labels(Map.of("string", "string"))
            .annotations(Map.of("string", "string"))
            .keepFiringFor("string")
            .notificationSettings(AlertRuleV0Alpha1SpecNotificationSettingsArgs.builder()
                .contactPoint("string")
                .activeTimings("string")
                .groupBies("string")
                .groupInterval("string")
                .groupWait("string")
                .muteTimings("string")
                .repeatInterval("string")
                .build())
            .panelRef("any")
            .paused(false)
            .for_("string")
            .trigger(AlertRuleV0Alpha1SpecTriggerArgs.builder()
                .interval("string")
                .build())
            .build())
        .build());
    
    alert_rule_v0_alpha1_resource = grafana.alerting.AlertRuleV0Alpha1("alertRuleV0Alpha1Resource",
        metadata={
            "uid": "string",
            "annotations": {
                "string": "string",
            },
            "folder_uid": "string",
            "url": "string",
            "uuid": "string",
            "version": "string",
        },
        options={
            "overwrite": False,
        },
        spec={
            "no_data_state": "string",
            "exec_err_state": "string",
            "expressions": "any",
            "title": "string",
            "missing_series_evals_to_resolve": 0,
            "labels": {
                "string": "string",
            },
            "annotations": {
                "string": "string",
            },
            "keep_firing_for": "string",
            "notification_settings": {
                "contact_point": "string",
                "active_timings": ["string"],
                "group_bies": ["string"],
                "group_interval": "string",
                "group_wait": "string",
                "mute_timings": ["string"],
                "repeat_interval": "string",
            },
            "panel_ref": "any",
            "paused": False,
            "for_": "string",
            "trigger": {
                "interval": "string",
            },
        })
    
    const alertRuleV0Alpha1Resource = new grafana.alerting.AlertRuleV0Alpha1("alertRuleV0Alpha1Resource", {
        metadata: {
            uid: "string",
            annotations: {
                string: "string",
            },
            folderUid: "string",
            url: "string",
            uuid: "string",
            version: "string",
        },
        options: {
            overwrite: false,
        },
        spec: {
            noDataState: "string",
            execErrState: "string",
            expressions: "any",
            title: "string",
            missingSeriesEvalsToResolve: 0,
            labels: {
                string: "string",
            },
            annotations: {
                string: "string",
            },
            keepFiringFor: "string",
            notificationSettings: {
                contactPoint: "string",
                activeTimings: ["string"],
                groupBies: ["string"],
                groupInterval: "string",
                groupWait: "string",
                muteTimings: ["string"],
                repeatInterval: "string",
            },
            panelRef: "any",
            paused: false,
            "for": "string",
            trigger: {
                interval: "string",
            },
        },
    });
    
    type: grafana:alerting:AlertRuleV0Alpha1
    properties:
        metadata:
            annotations:
                string: string
            folderUid: string
            uid: string
            url: string
            uuid: string
            version: string
        options:
            overwrite: false
        spec:
            annotations:
                string: string
            execErrState: string
            expressions: any
            for: string
            keepFiringFor: string
            labels:
                string: string
            missingSeriesEvalsToResolve: 0
            noDataState: string
            notificationSettings:
                activeTimings:
                    - string
                contactPoint: string
                groupBies:
                    - string
                groupInterval: string
                groupWait: string
                muteTimings:
                    - string
                repeatInterval: string
            panelRef: any
            paused: false
            title: string
            trigger:
                interval: string
    

    AlertRuleV0Alpha1 Resource Properties

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

    Inputs

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

    The AlertRuleV0Alpha1 resource accepts the following input properties:

    Metadata AlertRuleV0Alpha1MetadataArgs
    The metadata of the resource.
    Options AlertRuleV0Alpha1OptionsArgs
    Options for applying the resource.
    Spec AlertRuleV0Alpha1SpecArgs
    The spec of the resource.
    metadata AlertRuleV0Alpha1Metadata
    The metadata of the resource.
    options AlertRuleV0Alpha1Options
    Options for applying the resource.
    spec AlertRuleV0Alpha1Spec
    The spec of the resource.
    metadata AlertRuleV0Alpha1Metadata
    The metadata of the resource.
    options AlertRuleV0Alpha1Options
    Options for applying the resource.
    spec AlertRuleV0Alpha1Spec
    The spec of the resource.
    metadata AlertRuleV0Alpha1MetadataArgs
    The metadata of the resource.
    options AlertRuleV0Alpha1OptionsArgs
    Options for applying the resource.
    spec AlertRuleV0Alpha1SpecArgs
    The spec of the resource.
    metadata Property Map
    The metadata of the resource.
    options Property Map
    Options for applying the resource.
    spec Property Map
    The spec of the resource.

    Outputs

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

    Get an existing AlertRuleV0Alpha1 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?: AlertRuleV0Alpha1State, opts?: CustomResourceOptions): AlertRuleV0Alpha1
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            metadata: Optional[AlertRuleV0Alpha1MetadataArgs] = None,
            options: Optional[AlertRuleV0Alpha1OptionsArgs] = None,
            spec: Optional[AlertRuleV0Alpha1SpecArgs] = None) -> AlertRuleV0Alpha1
    func GetAlertRuleV0Alpha1(ctx *Context, name string, id IDInput, state *AlertRuleV0Alpha1State, opts ...ResourceOption) (*AlertRuleV0Alpha1, error)
    public static AlertRuleV0Alpha1 Get(string name, Input<string> id, AlertRuleV0Alpha1State? state, CustomResourceOptions? opts = null)
    public static AlertRuleV0Alpha1 get(String name, Output<String> id, AlertRuleV0Alpha1State state, CustomResourceOptions options)
    resources:  _:    type: grafana:alerting:AlertRuleV0Alpha1    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Metadata AlertRuleV0Alpha1MetadataArgs
    The metadata of the resource.
    Options AlertRuleV0Alpha1OptionsArgs
    Options for applying the resource.
    Spec AlertRuleV0Alpha1SpecArgs
    The spec of the resource.
    metadata AlertRuleV0Alpha1Metadata
    The metadata of the resource.
    options AlertRuleV0Alpha1Options
    Options for applying the resource.
    spec AlertRuleV0Alpha1Spec
    The spec of the resource.
    metadata AlertRuleV0Alpha1Metadata
    The metadata of the resource.
    options AlertRuleV0Alpha1Options
    Options for applying the resource.
    spec AlertRuleV0Alpha1Spec
    The spec of the resource.
    metadata AlertRuleV0Alpha1MetadataArgs
    The metadata of the resource.
    options AlertRuleV0Alpha1OptionsArgs
    Options for applying the resource.
    spec AlertRuleV0Alpha1SpecArgs
    The spec of the resource.
    metadata Property Map
    The metadata of the resource.
    options Property Map
    Options for applying the resource.
    spec Property Map
    The spec of the resource.

    Supporting Types

    AlertRuleV0Alpha1Metadata, AlertRuleV0Alpha1MetadataArgs

    Uid string
    The unique identifier of the resource.
    Annotations Dictionary<string, string>
    Annotations of the resource.
    FolderUid string
    The UID of the folder to save the resource in.
    Url string
    The full URL of the resource.
    Uuid string
    The globally unique identifier of a resource, used by the API for tracking.
    Version string
    The version of the resource.
    Uid string
    The unique identifier of the resource.
    Annotations map[string]string
    Annotations of the resource.
    FolderUid string
    The UID of the folder to save the resource in.
    Url string
    The full URL of the resource.
    Uuid string
    The globally unique identifier of a resource, used by the API for tracking.
    Version string
    The version of the resource.
    uid String
    The unique identifier of the resource.
    annotations Map<String,String>
    Annotations of the resource.
    folderUid String
    The UID of the folder to save the resource in.
    url String
    The full URL of the resource.
    uuid String
    The globally unique identifier of a resource, used by the API for tracking.
    version String
    The version of the resource.
    uid string
    The unique identifier of the resource.
    annotations {[key: string]: string}
    Annotations of the resource.
    folderUid string
    The UID of the folder to save the resource in.
    url string
    The full URL of the resource.
    uuid string
    The globally unique identifier of a resource, used by the API for tracking.
    version string
    The version of the resource.
    uid str
    The unique identifier of the resource.
    annotations Mapping[str, str]
    Annotations of the resource.
    folder_uid str
    The UID of the folder to save the resource in.
    url str
    The full URL of the resource.
    uuid str
    The globally unique identifier of a resource, used by the API for tracking.
    version str
    The version of the resource.
    uid String
    The unique identifier of the resource.
    annotations Map<String>
    Annotations of the resource.
    folderUid String
    The UID of the folder to save the resource in.
    url String
    The full URL of the resource.
    uuid String
    The globally unique identifier of a resource, used by the API for tracking.
    version String
    The version of the resource.

    AlertRuleV0Alpha1Options, AlertRuleV0Alpha1OptionsArgs

    Overwrite bool
    Set to true if you want to overwrite existing resource with newer version, same resource title in folder or same resource uid.
    Overwrite bool
    Set to true if you want to overwrite existing resource with newer version, same resource title in folder or same resource uid.
    overwrite Boolean
    Set to true if you want to overwrite existing resource with newer version, same resource title in folder or same resource uid.
    overwrite boolean
    Set to true if you want to overwrite existing resource with newer version, same resource title in folder or same resource uid.
    overwrite bool
    Set to true if you want to overwrite existing resource with newer version, same resource title in folder or same resource uid.
    overwrite Boolean
    Set to true if you want to overwrite existing resource with newer version, same resource title in folder or same resource uid.

    AlertRuleV0Alpha1Spec, AlertRuleV0Alpha1SpecArgs

    ExecErrState string
    Describes what state to enter when the rule's query is invalid and the rule cannot be executed. Options are OK, Error, KeepLast, and Alerting.
    Expressions object
    A sequence of stages that describe the contents of the rule.
    NoDataState string
    Describes what state to enter when the rule's query returns No Data. Options are OK, NoData, KeepLast, and Alerting.
    Title string
    The title of the alert rule.
    Annotations Dictionary<string, string>
    Key-value pairs of metadata to attach to the alert rule. They add additional information, such as a summary or runbook_url, to help identify and investigate alerts.
    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.
    KeepFiringFor string
    The amount of time for which the rule will considered to be Recovering after initially Firing. Before this time has elapsed, the rule will continue to fire once it's been triggered.
    Labels Dictionary<string, string>
    Key-value pairs to attach to the alert rule that can be used in matching, grouping, and routing.
    MissingSeriesEvalsToResolve int
    The number of missing series evaluations that must occur before the rule is considered to be resolved.
    NotificationSettings Pulumiverse.Grafana.Alerting.Inputs.AlertRuleV0Alpha1SpecNotificationSettings
    Notification settings for the rule. If specified, it overrides the notification policies.
    PanelRef object
    Reference to a panel that this alert rule is associated with. Should be an object with 'dashboarduid' (string) and 'panelid' (number) fields.
    Paused bool
    Sets whether the rule should be paused or not.
    Trigger Pulumiverse.Grafana.Alerting.Inputs.AlertRuleV0Alpha1SpecTrigger
    The trigger configuration for the alert rule.
    ExecErrState string
    Describes what state to enter when the rule's query is invalid and the rule cannot be executed. Options are OK, Error, KeepLast, and Alerting.
    Expressions interface{}
    A sequence of stages that describe the contents of the rule.
    NoDataState string
    Describes what state to enter when the rule's query returns No Data. Options are OK, NoData, KeepLast, and Alerting.
    Title string
    The title of the alert rule.
    Annotations map[string]string
    Key-value pairs of metadata to attach to the alert rule. They add additional information, such as a summary or runbook_url, to help identify and investigate alerts.
    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.
    KeepFiringFor string
    The amount of time for which the rule will considered to be Recovering after initially Firing. Before this time has elapsed, the rule will continue to fire once it's been triggered.
    Labels map[string]string
    Key-value pairs to attach to the alert rule that can be used in matching, grouping, and routing.
    MissingSeriesEvalsToResolve int
    The number of missing series evaluations that must occur before the rule is considered to be resolved.
    NotificationSettings AlertRuleV0Alpha1SpecNotificationSettings
    Notification settings for the rule. If specified, it overrides the notification policies.
    PanelRef interface{}
    Reference to a panel that this alert rule is associated with. Should be an object with 'dashboarduid' (string) and 'panelid' (number) fields.
    Paused bool
    Sets whether the rule should be paused or not.
    Trigger AlertRuleV0Alpha1SpecTrigger
    The trigger configuration for the alert rule.
    execErrState String
    Describes what state to enter when the rule's query is invalid and the rule cannot be executed. Options are OK, Error, KeepLast, and Alerting.
    expressions Object
    A sequence of stages that describe the contents of the rule.
    noDataState String
    Describes what state to enter when the rule's query returns No Data. Options are OK, NoData, KeepLast, and Alerting.
    title String
    The title of the alert rule.
    annotations Map<String,String>
    Key-value pairs of metadata to attach to the alert rule. They add additional information, such as a summary or runbook_url, to help identify and investigate alerts.
    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.
    keepFiringFor String
    The amount of time for which the rule will considered to be Recovering after initially Firing. Before this time has elapsed, the rule will continue to fire once it's been triggered.
    labels Map<String,String>
    Key-value pairs to attach to the alert rule that can be used in matching, grouping, and routing.
    missingSeriesEvalsToResolve Integer
    The number of missing series evaluations that must occur before the rule is considered to be resolved.
    notificationSettings AlertRuleV0Alpha1SpecNotificationSettings
    Notification settings for the rule. If specified, it overrides the notification policies.
    panelRef Object
    Reference to a panel that this alert rule is associated with. Should be an object with 'dashboarduid' (string) and 'panelid' (number) fields.
    paused Boolean
    Sets whether the rule should be paused or not.
    trigger AlertRuleV0Alpha1SpecTrigger
    The trigger configuration for the alert rule.
    execErrState string
    Describes what state to enter when the rule's query is invalid and the rule cannot be executed. Options are OK, Error, KeepLast, and Alerting.
    expressions any
    A sequence of stages that describe the contents of the rule.
    noDataState string
    Describes what state to enter when the rule's query returns No Data. Options are OK, NoData, KeepLast, and Alerting.
    title string
    The title of the alert rule.
    annotations {[key: string]: string}
    Key-value pairs of metadata to attach to the alert rule. They add additional information, such as a summary or runbook_url, to help identify and investigate alerts.
    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.
    keepFiringFor string
    The amount of time for which the rule will considered to be Recovering after initially Firing. Before this time has elapsed, the rule will continue to fire once it's been triggered.
    labels {[key: string]: string}
    Key-value pairs to attach to the alert rule that can be used in matching, grouping, and routing.
    missingSeriesEvalsToResolve number
    The number of missing series evaluations that must occur before the rule is considered to be resolved.
    notificationSettings AlertRuleV0Alpha1SpecNotificationSettings
    Notification settings for the rule. If specified, it overrides the notification policies.
    panelRef any
    Reference to a panel that this alert rule is associated with. Should be an object with 'dashboarduid' (string) and 'panelid' (number) fields.
    paused boolean
    Sets whether the rule should be paused or not.
    trigger AlertRuleV0Alpha1SpecTrigger
    The trigger configuration for the alert rule.
    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, KeepLast, and Alerting.
    expressions Any
    A sequence of stages that describe the contents of the rule.
    no_data_state str
    Describes what state to enter when the rule's query returns No Data. Options are OK, NoData, KeepLast, and Alerting.
    title str
    The title of the alert rule.
    annotations Mapping[str, str]
    Key-value pairs of metadata to attach to the alert rule. They add additional information, such as a summary or runbook_url, to help identify and investigate alerts.
    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.
    keep_firing_for str
    The amount of time for which the rule will considered to be Recovering after initially Firing. Before this time has elapsed, the rule will continue to fire once it's been triggered.
    labels Mapping[str, str]
    Key-value pairs to attach to the alert rule that can be used in matching, grouping, and routing.
    missing_series_evals_to_resolve int
    The number of missing series evaluations that must occur before the rule is considered to be resolved.
    notification_settings AlertRuleV0Alpha1SpecNotificationSettings
    Notification settings for the rule. If specified, it overrides the notification policies.
    panel_ref Any
    Reference to a panel that this alert rule is associated with. Should be an object with 'dashboarduid' (string) and 'panelid' (number) fields.
    paused bool
    Sets whether the rule should be paused or not.
    trigger AlertRuleV0Alpha1SpecTrigger
    The trigger configuration for the alert rule.
    execErrState String
    Describes what state to enter when the rule's query is invalid and the rule cannot be executed. Options are OK, Error, KeepLast, and Alerting.
    expressions Any
    A sequence of stages that describe the contents of the rule.
    noDataState String
    Describes what state to enter when the rule's query returns No Data. Options are OK, NoData, KeepLast, and Alerting.
    title String
    The title of the alert rule.
    annotations Map<String>
    Key-value pairs of metadata to attach to the alert rule. They add additional information, such as a summary or runbook_url, to help identify and investigate alerts.
    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.
    keepFiringFor String
    The amount of time for which the rule will considered to be Recovering after initially Firing. Before this time has elapsed, the rule will continue to fire once it's been triggered.
    labels Map<String>
    Key-value pairs to attach to the alert rule that can be used in matching, grouping, and routing.
    missingSeriesEvalsToResolve Number
    The number of missing series evaluations that must occur before the rule is considered to be resolved.
    notificationSettings Property Map
    Notification settings for the rule. If specified, it overrides the notification policies.
    panelRef Any
    Reference to a panel that this alert rule is associated with. Should be an object with 'dashboarduid' (string) and 'panelid' (number) fields.
    paused Boolean
    Sets whether the rule should be paused or not.
    trigger Property Map
    The trigger configuration for the alert rule.

    AlertRuleV0Alpha1SpecNotificationSettings, AlertRuleV0Alpha1SpecNotificationSettingsArgs

    ContactPoint string
    The contact point to route notifications that match this rule to.
    ActiveTimings List<string>
    A list of time interval names to apply to alerts that match this policy to suppress them unless they are sent at the specified time.
    GroupBies List<string>
    A list of alert labels to group alerts into notifications by.
    GroupInterval string
    Minimum time interval between two notifications for the same group.
    GroupWait string
    Time to wait to buffer alerts of the same group before sending a notification.
    MuteTimings List<string>
    A list of mute timing names to apply to alerts that match this policy.
    RepeatInterval string
    Minimum time interval for re-sending a notification if an alert is still firing.
    ContactPoint string
    The contact point to route notifications that match this rule to.
    ActiveTimings []string
    A list of time interval names to apply to alerts that match this policy to suppress them unless they are sent at the specified time.
    GroupBies []string
    A list of alert labels to group alerts into notifications by.
    GroupInterval string
    Minimum time interval between two notifications for the same group.
    GroupWait string
    Time to wait to buffer alerts of the same group before sending a notification.
    MuteTimings []string
    A list of mute timing names to apply to alerts that match this policy.
    RepeatInterval string
    Minimum time interval for re-sending a notification if an alert is still firing.
    contactPoint String
    The contact point to route notifications that match this rule to.
    activeTimings List<String>
    A list of time interval names to apply to alerts that match this policy to suppress them unless they are sent at the specified time.
    groupBies List<String>
    A list of alert labels to group alerts into notifications by.
    groupInterval String
    Minimum time interval between two notifications for the same group.
    groupWait String
    Time to wait to buffer alerts of the same group before sending a notification.
    muteTimings List<String>
    A list of mute timing names to apply to alerts that match this policy.
    repeatInterval String
    Minimum time interval for re-sending a notification if an alert is still firing.
    contactPoint string
    The contact point to route notifications that match this rule to.
    activeTimings string[]
    A list of time interval names to apply to alerts that match this policy to suppress them unless they are sent at the specified time.
    groupBies string[]
    A list of alert labels to group alerts into notifications by.
    groupInterval string
    Minimum time interval between two notifications for the same group.
    groupWait string
    Time to wait to buffer alerts of the same group before sending a notification.
    muteTimings string[]
    A list of mute timing names to apply to alerts that match this policy.
    repeatInterval string
    Minimum time interval for re-sending a notification if an alert is still firing.
    contact_point str
    The contact point to route notifications that match this rule to.
    active_timings Sequence[str]
    A list of time interval names to apply to alerts that match this policy to suppress them unless they are sent at the specified time.
    group_bies Sequence[str]
    A list of alert labels to group alerts into notifications by.
    group_interval str
    Minimum time interval between two notifications for the same group.
    group_wait str
    Time to wait to buffer alerts of the same group before sending a notification.
    mute_timings Sequence[str]
    A list of mute timing names to apply to alerts that match this policy.
    repeat_interval str
    Minimum time interval for re-sending a notification if an alert is still firing.
    contactPoint String
    The contact point to route notifications that match this rule to.
    activeTimings List<String>
    A list of time interval names to apply to alerts that match this policy to suppress them unless they are sent at the specified time.
    groupBies List<String>
    A list of alert labels to group alerts into notifications by.
    groupInterval String
    Minimum time interval between two notifications for the same group.
    groupWait String
    Time to wait to buffer alerts of the same group before sending a notification.
    muteTimings List<String>
    A list of mute timing names to apply to alerts that match this policy.
    repeatInterval String
    Minimum time interval for re-sending a notification if an alert is still firing.

    AlertRuleV0Alpha1SpecTrigger, AlertRuleV0Alpha1SpecTriggerArgs

    Interval string
    The interval at which the alert rule should be evaluated.
    Interval string
    The interval at which the alert rule should be evaluated.
    interval String
    The interval at which the alert rule should be evaluated.
    interval string
    The interval at which the alert rule should be evaluated.
    interval str
    The interval at which the alert rule should be evaluated.
    interval String
    The interval at which the alert rule should be evaluated.

    Package Details

    Repository
    grafana pulumiverse/pulumi-grafana
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the grafana Terraform Provider.
    grafana logo
    Grafana v2.15.0 published on Wednesday, Nov 12, 2025 by pulumiverse
      Meet Neo: Your AI Platform Teammate