1. Packages
  2. stackit
  3. API Docs
  4. ObservabilityAlertgroup
Viewing docs for stackit v0.0.4
published on Friday, Feb 20, 2026 by stackitcloud
stackit logo
Viewing docs for stackit v0.0.4
published on Friday, Feb 20, 2026 by stackitcloud

    Observability alert group resource schema. Used to create alerts based on metrics (Thanos). Must have a region specified in the provider configuration.

    Example Usage

    resource "stackit_observability_alertgroup" "example" {
      project_id  = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
      instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
      name        = "example-alert-group"
      interval    = "60s"
      rules = [
        {
          alert      = "example-alert-name"
          expression = "kube_node_status_condition{condition=\"Ready\", status=\"false\"} > 0"
          for        = "60s"
          labels = {
            severity = "critical"
          },
          annotations = {
            summary : "example summary"
            description : "example description"
          }
        },
        {
          expression = "kube_node_status_condition{condition=\"Ready\", status=\"false\"} > 0"
          labels = {
            severity = "critical"
          },
          record = "example_record_name"
        },
      ]
    }
    
    # Only use the import statement, if you want to import an existing observability alertgroup
    import {
      to = stackit_observability_alertgroup.import-example
      id = "${var.project_id},${var.observability_instance_id},${var.observability_alertgroup_name}"
    }
    

    Create ObservabilityAlertgroup Resource

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

    Constructor syntax

    new ObservabilityAlertgroup(name: string, args: ObservabilityAlertgroupArgs, opts?: CustomResourceOptions);
    @overload
    def ObservabilityAlertgroup(resource_name: str,
                                args: ObservabilityAlertgroupArgs,
                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def ObservabilityAlertgroup(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                instance_id: Optional[str] = None,
                                project_id: Optional[str] = None,
                                rules: Optional[Sequence[ObservabilityAlertgroupRuleArgs]] = None,
                                interval: Optional[str] = None,
                                name: Optional[str] = None)
    func NewObservabilityAlertgroup(ctx *Context, name string, args ObservabilityAlertgroupArgs, opts ...ResourceOption) (*ObservabilityAlertgroup, error)
    public ObservabilityAlertgroup(string name, ObservabilityAlertgroupArgs args, CustomResourceOptions? opts = null)
    public ObservabilityAlertgroup(String name, ObservabilityAlertgroupArgs args)
    public ObservabilityAlertgroup(String name, ObservabilityAlertgroupArgs args, CustomResourceOptions options)
    
    type: stackit:ObservabilityAlertgroup
    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 ObservabilityAlertgroupArgs
    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 ObservabilityAlertgroupArgs
    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 ObservabilityAlertgroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ObservabilityAlertgroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ObservabilityAlertgroupArgs
    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 observabilityAlertgroupResource = new Stackit.ObservabilityAlertgroup("observabilityAlertgroupResource", new()
    {
        InstanceId = "string",
        ProjectId = "string",
        Rules = new[]
        {
            new Stackit.Inputs.ObservabilityAlertgroupRuleArgs
            {
                Expression = "string",
                Alert = "string",
                Annotations = 
                {
                    { "string", "string" },
                },
                For = "string",
                Labels = 
                {
                    { "string", "string" },
                },
                Record = "string",
            },
        },
        Interval = "string",
        Name = "string",
    });
    
    example, err := stackit.NewObservabilityAlertgroup(ctx, "observabilityAlertgroupResource", &stackit.ObservabilityAlertgroupArgs{
    	InstanceId: pulumi.String("string"),
    	ProjectId:  pulumi.String("string"),
    	Rules: stackit.ObservabilityAlertgroupRuleArray{
    		&stackit.ObservabilityAlertgroupRuleArgs{
    			Expression: pulumi.String("string"),
    			Alert:      pulumi.String("string"),
    			Annotations: pulumi.StringMap{
    				"string": pulumi.String("string"),
    			},
    			For: pulumi.String("string"),
    			Labels: pulumi.StringMap{
    				"string": pulumi.String("string"),
    			},
    			Record: pulumi.String("string"),
    		},
    	},
    	Interval: pulumi.String("string"),
    	Name:     pulumi.String("string"),
    })
    
    var observabilityAlertgroupResource = new ObservabilityAlertgroup("observabilityAlertgroupResource", ObservabilityAlertgroupArgs.builder()
        .instanceId("string")
        .projectId("string")
        .rules(ObservabilityAlertgroupRuleArgs.builder()
            .expression("string")
            .alert("string")
            .annotations(Map.of("string", "string"))
            .for_("string")
            .labels(Map.of("string", "string"))
            .record("string")
            .build())
        .interval("string")
        .name("string")
        .build());
    
    observability_alertgroup_resource = stackit.ObservabilityAlertgroup("observabilityAlertgroupResource",
        instance_id="string",
        project_id="string",
        rules=[{
            "expression": "string",
            "alert": "string",
            "annotations": {
                "string": "string",
            },
            "for_": "string",
            "labels": {
                "string": "string",
            },
            "record": "string",
        }],
        interval="string",
        name="string")
    
    const observabilityAlertgroupResource = new stackit.ObservabilityAlertgroup("observabilityAlertgroupResource", {
        instanceId: "string",
        projectId: "string",
        rules: [{
            expression: "string",
            alert: "string",
            annotations: {
                string: "string",
            },
            "for": "string",
            labels: {
                string: "string",
            },
            record: "string",
        }],
        interval: "string",
        name: "string",
    });
    
    type: stackit:ObservabilityAlertgroup
    properties:
        instanceId: string
        interval: string
        name: string
        projectId: string
        rules:
            - alert: string
              annotations:
                string: string
              expression: string
              for: string
              labels:
                string: string
              record: string
    

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

    InstanceId string
    Observability instance ID to which the alert group is associated.
    ProjectId string
    STACKIT project ID to which the alert group is associated.
    Rules List<ObservabilityAlertgroupRule>
    Rules for the alert group
    Interval string
    Specifies the frequency at which rules within the group are evaluated. The interval must be at least 60 seconds and defaults to 60 seconds if not set. Supported formats include hours, minutes, and seconds, either singly or in combination. Examples of valid formats are: '5h30m40s', '5h', '5h30m', '60m', and '60s'.
    Name string
    The name of the alert group. Is the identifier and must be unique in the group.
    InstanceId string
    Observability instance ID to which the alert group is associated.
    ProjectId string
    STACKIT project ID to which the alert group is associated.
    Rules []ObservabilityAlertgroupRuleArgs
    Rules for the alert group
    Interval string
    Specifies the frequency at which rules within the group are evaluated. The interval must be at least 60 seconds and defaults to 60 seconds if not set. Supported formats include hours, minutes, and seconds, either singly or in combination. Examples of valid formats are: '5h30m40s', '5h', '5h30m', '60m', and '60s'.
    Name string
    The name of the alert group. Is the identifier and must be unique in the group.
    instanceId String
    Observability instance ID to which the alert group is associated.
    projectId String
    STACKIT project ID to which the alert group is associated.
    rules List<ObservabilityAlertgroupRule>
    Rules for the alert group
    interval String
    Specifies the frequency at which rules within the group are evaluated. The interval must be at least 60 seconds and defaults to 60 seconds if not set. Supported formats include hours, minutes, and seconds, either singly or in combination. Examples of valid formats are: '5h30m40s', '5h', '5h30m', '60m', and '60s'.
    name String
    The name of the alert group. Is the identifier and must be unique in the group.
    instanceId string
    Observability instance ID to which the alert group is associated.
    projectId string
    STACKIT project ID to which the alert group is associated.
    rules ObservabilityAlertgroupRule[]
    Rules for the alert group
    interval string
    Specifies the frequency at which rules within the group are evaluated. The interval must be at least 60 seconds and defaults to 60 seconds if not set. Supported formats include hours, minutes, and seconds, either singly or in combination. Examples of valid formats are: '5h30m40s', '5h', '5h30m', '60m', and '60s'.
    name string
    The name of the alert group. Is the identifier and must be unique in the group.
    instance_id str
    Observability instance ID to which the alert group is associated.
    project_id str
    STACKIT project ID to which the alert group is associated.
    rules Sequence[ObservabilityAlertgroupRuleArgs]
    Rules for the alert group
    interval str
    Specifies the frequency at which rules within the group are evaluated. The interval must be at least 60 seconds and defaults to 60 seconds if not set. Supported formats include hours, minutes, and seconds, either singly or in combination. Examples of valid formats are: '5h30m40s', '5h', '5h30m', '60m', and '60s'.
    name str
    The name of the alert group. Is the identifier and must be unique in the group.
    instanceId String
    Observability instance ID to which the alert group is associated.
    projectId String
    STACKIT project ID to which the alert group is associated.
    rules List<Property Map>
    Rules for the alert group
    interval String
    Specifies the frequency at which rules within the group are evaluated. The interval must be at least 60 seconds and defaults to 60 seconds if not set. Supported formats include hours, minutes, and seconds, either singly or in combination. Examples of valid formats are: '5h30m40s', '5h', '5h30m', '60m', and '60s'.
    name String
    The name of the alert group. Is the identifier and must be unique in the group.

    Outputs

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

    Get an existing ObservabilityAlertgroup 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?: ObservabilityAlertgroupState, opts?: CustomResourceOptions): ObservabilityAlertgroup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            instance_id: Optional[str] = None,
            interval: Optional[str] = None,
            name: Optional[str] = None,
            project_id: Optional[str] = None,
            rules: Optional[Sequence[ObservabilityAlertgroupRuleArgs]] = None) -> ObservabilityAlertgroup
    func GetObservabilityAlertgroup(ctx *Context, name string, id IDInput, state *ObservabilityAlertgroupState, opts ...ResourceOption) (*ObservabilityAlertgroup, error)
    public static ObservabilityAlertgroup Get(string name, Input<string> id, ObservabilityAlertgroupState? state, CustomResourceOptions? opts = null)
    public static ObservabilityAlertgroup get(String name, Output<String> id, ObservabilityAlertgroupState state, CustomResourceOptions options)
    resources:  _:    type: stackit:ObservabilityAlertgroup    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:
    InstanceId string
    Observability instance ID to which the alert group is associated.
    Interval string
    Specifies the frequency at which rules within the group are evaluated. The interval must be at least 60 seconds and defaults to 60 seconds if not set. Supported formats include hours, minutes, and seconds, either singly or in combination. Examples of valid formats are: '5h30m40s', '5h', '5h30m', '60m', and '60s'.
    Name string
    The name of the alert group. Is the identifier and must be unique in the group.
    ProjectId string
    STACKIT project ID to which the alert group is associated.
    Rules List<ObservabilityAlertgroupRule>
    Rules for the alert group
    InstanceId string
    Observability instance ID to which the alert group is associated.
    Interval string
    Specifies the frequency at which rules within the group are evaluated. The interval must be at least 60 seconds and defaults to 60 seconds if not set. Supported formats include hours, minutes, and seconds, either singly or in combination. Examples of valid formats are: '5h30m40s', '5h', '5h30m', '60m', and '60s'.
    Name string
    The name of the alert group. Is the identifier and must be unique in the group.
    ProjectId string
    STACKIT project ID to which the alert group is associated.
    Rules []ObservabilityAlertgroupRuleArgs
    Rules for the alert group
    instanceId String
    Observability instance ID to which the alert group is associated.
    interval String
    Specifies the frequency at which rules within the group are evaluated. The interval must be at least 60 seconds and defaults to 60 seconds if not set. Supported formats include hours, minutes, and seconds, either singly or in combination. Examples of valid formats are: '5h30m40s', '5h', '5h30m', '60m', and '60s'.
    name String
    The name of the alert group. Is the identifier and must be unique in the group.
    projectId String
    STACKIT project ID to which the alert group is associated.
    rules List<ObservabilityAlertgroupRule>
    Rules for the alert group
    instanceId string
    Observability instance ID to which the alert group is associated.
    interval string
    Specifies the frequency at which rules within the group are evaluated. The interval must be at least 60 seconds and defaults to 60 seconds if not set. Supported formats include hours, minutes, and seconds, either singly or in combination. Examples of valid formats are: '5h30m40s', '5h', '5h30m', '60m', and '60s'.
    name string
    The name of the alert group. Is the identifier and must be unique in the group.
    projectId string
    STACKIT project ID to which the alert group is associated.
    rules ObservabilityAlertgroupRule[]
    Rules for the alert group
    instance_id str
    Observability instance ID to which the alert group is associated.
    interval str
    Specifies the frequency at which rules within the group are evaluated. The interval must be at least 60 seconds and defaults to 60 seconds if not set. Supported formats include hours, minutes, and seconds, either singly or in combination. Examples of valid formats are: '5h30m40s', '5h', '5h30m', '60m', and '60s'.
    name str
    The name of the alert group. Is the identifier and must be unique in the group.
    project_id str
    STACKIT project ID to which the alert group is associated.
    rules Sequence[ObservabilityAlertgroupRuleArgs]
    Rules for the alert group
    instanceId String
    Observability instance ID to which the alert group is associated.
    interval String
    Specifies the frequency at which rules within the group are evaluated. The interval must be at least 60 seconds and defaults to 60 seconds if not set. Supported formats include hours, minutes, and seconds, either singly or in combination. Examples of valid formats are: '5h30m40s', '5h', '5h30m', '60m', and '60s'.
    name String
    The name of the alert group. Is the identifier and must be unique in the group.
    projectId String
    STACKIT project ID to which the alert group is associated.
    rules List<Property Map>
    Rules for the alert group

    Supporting Types

    ObservabilityAlertgroupRule, ObservabilityAlertgroupRuleArgs

    Expression string
    The PromQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and all resultant time series become pending/firing alerts.
    Alert string
    The name of the alert rule. Is the identifier and must be unique in the group.
    Annotations Dictionary<string, string>
    A map of key:value. Annotations to add or overwrite for each alert
    For string
    Alerts are considered firing once they have been returned for this long. Alerts which have not yet fired for long enough are considered pending. Default is 0s
    Labels Dictionary<string, string>
    A map of key:value. Labels to add or overwrite for each alert
    Record string
    The name of the metric. It's the identifier and must be unique in the group.
    Expression string
    The PromQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and all resultant time series become pending/firing alerts.
    Alert string
    The name of the alert rule. Is the identifier and must be unique in the group.
    Annotations map[string]string
    A map of key:value. Annotations to add or overwrite for each alert
    For string
    Alerts are considered firing once they have been returned for this long. Alerts which have not yet fired for long enough are considered pending. Default is 0s
    Labels map[string]string
    A map of key:value. Labels to add or overwrite for each alert
    Record string
    The name of the metric. It's the identifier and must be unique in the group.
    expression String
    The PromQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and all resultant time series become pending/firing alerts.
    alert String
    The name of the alert rule. Is the identifier and must be unique in the group.
    annotations Map<String,String>
    A map of key:value. Annotations to add or overwrite for each alert
    for_ String
    Alerts are considered firing once they have been returned for this long. Alerts which have not yet fired for long enough are considered pending. Default is 0s
    labels Map<String,String>
    A map of key:value. Labels to add or overwrite for each alert
    record String
    The name of the metric. It's the identifier and must be unique in the group.
    expression string
    The PromQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and all resultant time series become pending/firing alerts.
    alert string
    The name of the alert rule. Is the identifier and must be unique in the group.
    annotations {[key: string]: string}
    A map of key:value. Annotations to add or overwrite for each alert
    for string
    Alerts are considered firing once they have been returned for this long. Alerts which have not yet fired for long enough are considered pending. Default is 0s
    labels {[key: string]: string}
    A map of key:value. Labels to add or overwrite for each alert
    record string
    The name of the metric. It's the identifier and must be unique in the group.
    expression str
    The PromQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and all resultant time series become pending/firing alerts.
    alert str
    The name of the alert rule. Is the identifier and must be unique in the group.
    annotations Mapping[str, str]
    A map of key:value. Annotations to add or overwrite for each alert
    for_ str
    Alerts are considered firing once they have been returned for this long. Alerts which have not yet fired for long enough are considered pending. Default is 0s
    labels Mapping[str, str]
    A map of key:value. Labels to add or overwrite for each alert
    record str
    The name of the metric. It's the identifier and must be unique in the group.
    expression String
    The PromQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and all resultant time series become pending/firing alerts.
    alert String
    The name of the alert rule. Is the identifier and must be unique in the group.
    annotations Map<String>
    A map of key:value. Annotations to add or overwrite for each alert
    for String
    Alerts are considered firing once they have been returned for this long. Alerts which have not yet fired for long enough are considered pending. Default is 0s
    labels Map<String>
    A map of key:value. Labels to add or overwrite for each alert
    record String
    The name of the metric. It's the identifier and must be unique in the group.

    Package Details

    Repository
    stackit stackitcloud/pulumi-stackit
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the stackit Terraform Provider.
    stackit logo
    Viewing docs for stackit v0.0.4
    published on Friday, Feb 20, 2026 by stackitcloud
      Try Pulumi Cloud free. Your team will thank you.