All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.monitoring.kotlin.AlertPrometheusRuleGroupArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.21.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.monitoring.kotlin

import com.pulumi.azure.monitoring.AlertPrometheusRuleGroupArgs.builder
import com.pulumi.azure.monitoring.kotlin.inputs.AlertPrometheusRuleGroupRuleArgs
import com.pulumi.azure.monitoring.kotlin.inputs.AlertPrometheusRuleGroupRuleArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages an Alert Management Prometheus Rule Group.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleActionGroup = new azure.monitoring.ActionGroup("example", {
 *     name: "example-mag",
 *     resourceGroupName: example.name,
 *     shortName: "testag",
 * });
 * const exampleWorkspace = new azure.monitoring.Workspace("example", {
 *     name: "example-amw",
 *     resourceGroupName: example.name,
 *     location: example.location,
 * });
 * const exampleKubernetesCluster = new azure.containerservice.KubernetesCluster("example", {
 *     name: "example-cluster",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     dnsPrefix: "example-aks",
 *     defaultNodePool: {
 *         name: "default",
 *         nodeCount: 1,
 *         vmSize: "Standard_DS2_v2",
 *         enableHostEncryption: true,
 *     },
 *     identity: {
 *         type: "SystemAssigned",
 *     },
 * });
 * const exampleAlertPrometheusRuleGroup = new azure.monitoring.AlertPrometheusRuleGroup("example", {
 *     name: "example-amprg",
 *     location: "West Europe",
 *     resourceGroupName: example.name,
 *     clusterName: exampleKubernetesCluster.name,
 *     description: "This is the description of the following rule group",
 *     ruleGroupEnabled: false,
 *     interval: "PT1M",
 *     scopes: [exampleWorkspace.id],
 *     rules: [
 *         {
 *             enabled: false,
 *             expression: "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))\n",
 *             record: "job_type:billing_jobs_duration_seconds:99p5m",
 *             labels: {
 *                 team: "prod",
 *             },
 *         },
 *         {
 *             alert: "Billing_Processing_Very_Slow",
 *             enabled: true,
 *             expression: "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))\n",
 *             "for": "PT5M",
 *             severity: 2,
 *             actions: [{
 *                 actionGroupId: exampleActionGroup.id,
 *             }],
 *             alertResolution: {
 *                 autoResolved: true,
 *                 timeToResolve: "PT10M",
 *             },
 *             annotations: {
 *                 annotationName: "annotationValue",
 *             },
 *             labels: {
 *                 team: "prod",
 *             },
 *         },
 *     ],
 *     tags: {
 *         key: "value",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_action_group = azure.monitoring.ActionGroup("example",
 *     name="example-mag",
 *     resource_group_name=example.name,
 *     short_name="testag")
 * example_workspace = azure.monitoring.Workspace("example",
 *     name="example-amw",
 *     resource_group_name=example.name,
 *     location=example.location)
 * example_kubernetes_cluster = azure.containerservice.KubernetesCluster("example",
 *     name="example-cluster",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     dns_prefix="example-aks",
 *     default_node_pool=azure.containerservice.KubernetesClusterDefaultNodePoolArgs(
 *         name="default",
 *         node_count=1,
 *         vm_size="Standard_DS2_v2",
 *         enable_host_encryption=True,
 *     ),
 *     identity=azure.containerservice.KubernetesClusterIdentityArgs(
 *         type="SystemAssigned",
 *     ))
 * example_alert_prometheus_rule_group = azure.monitoring.AlertPrometheusRuleGroup("example",
 *     name="example-amprg",
 *     location="West Europe",
 *     resource_group_name=example.name,
 *     cluster_name=example_kubernetes_cluster.name,
 *     description="This is the description of the following rule group",
 *     rule_group_enabled=False,
 *     interval="PT1M",
 *     scopes=[example_workspace.id],
 *     rules=[
 *         azure.monitoring.AlertPrometheusRuleGroupRuleArgs(
 *             enabled=False,
 *             expression="histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))\n",
 *             record="job_type:billing_jobs_duration_seconds:99p5m",
 *             labels={
 *                 "team": "prod",
 *             },
 *         ),
 *         azure.monitoring.AlertPrometheusRuleGroupRuleArgs(
 *             alert="Billing_Processing_Very_Slow",
 *             enabled=True,
 *             expression="histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))\n",
 *             for_="PT5M",
 *             severity=2,
 *             actions=[azure.monitoring.AlertPrometheusRuleGroupRuleActionArgs(
 *                 action_group_id=example_action_group.id,
 *             )],
 *             alert_resolution=azure.monitoring.AlertPrometheusRuleGroupRuleAlertResolutionArgs(
 *                 auto_resolved=True,
 *                 time_to_resolve="PT10M",
 *             ),
 *             annotations={
 *                 "annotationName": "annotationValue",
 *             },
 *             labels={
 *                 "team": "prod",
 *             },
 *         ),
 *     ],
 *     tags={
 *         "key": "value",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleActionGroup = new Azure.Monitoring.ActionGroup("example", new()
 *     {
 *         Name = "example-mag",
 *         ResourceGroupName = example.Name,
 *         ShortName = "testag",
 *     });
 *     var exampleWorkspace = new Azure.Monitoring.Workspace("example", new()
 *     {
 *         Name = "example-amw",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *     });
 *     var exampleKubernetesCluster = new Azure.ContainerService.KubernetesCluster("example", new()
 *     {
 *         Name = "example-cluster",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         DnsPrefix = "example-aks",
 *         DefaultNodePool = new Azure.ContainerService.Inputs.KubernetesClusterDefaultNodePoolArgs
 *         {
 *             Name = "default",
 *             NodeCount = 1,
 *             VmSize = "Standard_DS2_v2",
 *             EnableHostEncryption = true,
 *         },
 *         Identity = new Azure.ContainerService.Inputs.KubernetesClusterIdentityArgs
 *         {
 *             Type = "SystemAssigned",
 *         },
 *     });
 *     var exampleAlertPrometheusRuleGroup = new Azure.Monitoring.AlertPrometheusRuleGroup("example", new()
 *     {
 *         Name = "example-amprg",
 *         Location = "West Europe",
 *         ResourceGroupName = example.Name,
 *         ClusterName = exampleKubernetesCluster.Name,
 *         Description = "This is the description of the following rule group",
 *         RuleGroupEnabled = false,
 *         Interval = "PT1M",
 *         Scopes = new[]
 *         {
 *             exampleWorkspace.Id,
 *         },
 *         Rules = new[]
 *         {
 *             new Azure.Monitoring.Inputs.AlertPrometheusRuleGroupRuleArgs
 *             {
 *                 Enabled = false,
 *                 Expression = @"histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=""billing-processing""}[5m])) by (job_type))
 * ",
 *                 Record = "job_type:billing_jobs_duration_seconds:99p5m",
 *                 Labels =
 *                 {
 *                     { "team", "prod" },
 *                 },
 *             },
 *             new Azure.Monitoring.Inputs.AlertPrometheusRuleGroupRuleArgs
 *             {
 *                 Alert = "Billing_Processing_Very_Slow",
 *                 Enabled = true,
 *                 Expression = @"histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=""billing-processing""}[5m])) by (job_type))
 * ",
 *                 For = "PT5M",
 *                 Severity = 2,
 *                 Actions = new[]
 *                 {
 *                     new Azure.Monitoring.Inputs.AlertPrometheusRuleGroupRuleActionArgs
 *                     {
 *                         ActionGroupId = exampleActionGroup.Id,
 *                     },
 *                 },
 *                 AlertResolution = new Azure.Monitoring.Inputs.AlertPrometheusRuleGroupRuleAlertResolutionArgs
 *                 {
 *                     AutoResolved = true,
 *                     TimeToResolve = "PT10M",
 *                 },
 *                 Annotations =
 *                 {
 *                     { "annotationName", "annotationValue" },
 *                 },
 *                 Labels =
 *                 {
 *                     { "team", "prod" },
 *                 },
 *             },
 *         },
 *         Tags =
 *         {
 *             { "key", "value" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleActionGroup, err := monitoring.NewActionGroup(ctx, "example", &monitoring.ActionGroupArgs{
 * 			Name:              pulumi.String("example-mag"),
 * 			ResourceGroupName: example.Name,
 * 			ShortName:         pulumi.String("testag"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleWorkspace, err := monitoring.NewWorkspace(ctx, "example", &monitoring.WorkspaceArgs{
 * 			Name:              pulumi.String("example-amw"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleKubernetesCluster, err := containerservice.NewKubernetesCluster(ctx, "example", &containerservice.KubernetesClusterArgs{
 * 			Name:              pulumi.String("example-cluster"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			DnsPrefix:         pulumi.String("example-aks"),
 * 			DefaultNodePool: &containerservice.KubernetesClusterDefaultNodePoolArgs{
 * 				Name:                 pulumi.String("default"),
 * 				NodeCount:            pulumi.Int(1),
 * 				VmSize:               pulumi.String("Standard_DS2_v2"),
 * 				EnableHostEncryption: pulumi.Bool(true),
 * 			},
 * 			Identity: &containerservice.KubernetesClusterIdentityArgs{
 * 				Type: pulumi.String("SystemAssigned"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = monitoring.NewAlertPrometheusRuleGroup(ctx, "example", &monitoring.AlertPrometheusRuleGroupArgs{
 * 			Name:              pulumi.String("example-amprg"),
 * 			Location:          pulumi.String("West Europe"),
 * 			ResourceGroupName: example.Name,
 * 			ClusterName:       exampleKubernetesCluster.Name,
 * 			Description:       pulumi.String("This is the description of the following rule group"),
 * 			RuleGroupEnabled:  pulumi.Bool(false),
 * 			Interval:          pulumi.String("PT1M"),
 * 			Scopes: pulumi.StringArray{
 * 				exampleWorkspace.ID(),
 * 			},
 * 			Rules: monitoring.AlertPrometheusRuleGroupRuleArray{
 * 				&monitoring.AlertPrometheusRuleGroupRuleArgs{
 * 					Enabled:    pulumi.Bool(false),
 * 					Expression: pulumi.String("histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))\n"),
 * 					Record:     pulumi.String("job_type:billing_jobs_duration_seconds:99p5m"),
 * 					Labels: pulumi.StringMap{
 * 						"team": pulumi.String("prod"),
 * 					},
 * 				},
 * 				&monitoring.AlertPrometheusRuleGroupRuleArgs{
 * 					Alert:      pulumi.String("Billing_Processing_Very_Slow"),
 * 					Enabled:    pulumi.Bool(true),
 * 					Expression: pulumi.String("histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\"billing-processing\"}[5m])) by (job_type))\n"),
 * 					For:        pulumi.String("PT5M"),
 * 					Severity:   pulumi.Int(2),
 * 					Actions: monitoring.AlertPrometheusRuleGroupRuleActionArray{
 * 						&monitoring.AlertPrometheusRuleGroupRuleActionArgs{
 * 							ActionGroupId: exampleActionGroup.ID(),
 * 						},
 * 					},
 * 					AlertResolution: &monitoring.AlertPrometheusRuleGroupRuleAlertResolutionArgs{
 * 						AutoResolved:  pulumi.Bool(true),
 * 						TimeToResolve: pulumi.String("PT10M"),
 * 					},
 * 					Annotations: pulumi.StringMap{
 * 						"annotationName": pulumi.String("annotationValue"),
 * 					},
 * 					Labels: pulumi.StringMap{
 * 						"team": pulumi.String("prod"),
 * 					},
 * 				},
 * 			},
 * 			Tags: pulumi.StringMap{
 * 				"key": pulumi.String("value"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.monitoring.ActionGroup;
 * import com.pulumi.azure.monitoring.ActionGroupArgs;
 * import com.pulumi.azure.monitoring.Workspace;
 * import com.pulumi.azure.monitoring.WorkspaceArgs;
 * import com.pulumi.azure.containerservice.KubernetesCluster;
 * import com.pulumi.azure.containerservice.KubernetesClusterArgs;
 * import com.pulumi.azure.containerservice.inputs.KubernetesClusterDefaultNodePoolArgs;
 * import com.pulumi.azure.containerservice.inputs.KubernetesClusterIdentityArgs;
 * import com.pulumi.azure.monitoring.AlertPrometheusRuleGroup;
 * import com.pulumi.azure.monitoring.AlertPrometheusRuleGroupArgs;
 * import com.pulumi.azure.monitoring.inputs.AlertPrometheusRuleGroupRuleArgs;
 * import com.pulumi.azure.monitoring.inputs.AlertPrometheusRuleGroupRuleAlertResolutionArgs;
 * 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleActionGroup = new ActionGroup("exampleActionGroup", ActionGroupArgs.builder()
 *             .name("example-mag")
 *             .resourceGroupName(example.name())
 *             .shortName("testag")
 *             .build());
 *         var exampleWorkspace = new Workspace("exampleWorkspace", WorkspaceArgs.builder()
 *             .name("example-amw")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .build());
 *         var exampleKubernetesCluster = new KubernetesCluster("exampleKubernetesCluster", KubernetesClusterArgs.builder()
 *             .name("example-cluster")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .dnsPrefix("example-aks")
 *             .defaultNodePool(KubernetesClusterDefaultNodePoolArgs.builder()
 *                 .name("default")
 *                 .nodeCount(1)
 *                 .vmSize("Standard_DS2_v2")
 *                 .enableHostEncryption(true)
 *                 .build())
 *             .identity(KubernetesClusterIdentityArgs.builder()
 *                 .type("SystemAssigned")
 *                 .build())
 *             .build());
 *         var exampleAlertPrometheusRuleGroup = new AlertPrometheusRuleGroup("exampleAlertPrometheusRuleGroup", AlertPrometheusRuleGroupArgs.builder()
 *             .name("example-amprg")
 *             .location("West Europe")
 *             .resourceGroupName(example.name())
 *             .clusterName(exampleKubernetesCluster.name())
 *             .description("This is the description of the following rule group")
 *             .ruleGroupEnabled(false)
 *             .interval("PT1M")
 *             .scopes(exampleWorkspace.id())
 *             .rules(
 *                 AlertPrometheusRuleGroupRuleArgs.builder()
 *                     .enabled(false)
 *                     .expression("""
 * histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service="billing-processing"}[5m])) by (job_type))
 *                     """)
 *                     .record("job_type:billing_jobs_duration_seconds:99p5m")
 *                     .labels(Map.of("team", "prod"))
 *                     .build(),
 *                 AlertPrometheusRuleGroupRuleArgs.builder()
 *                     .alert("Billing_Processing_Very_Slow")
 *                     .enabled(true)
 *                     .expression("""
 * histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service="billing-processing"}[5m])) by (job_type))
 *                     """)
 *                     .for_("PT5M")
 *                     .severity(2)
 *                     .actions(AlertPrometheusRuleGroupRuleActionArgs.builder()
 *                         .actionGroupId(exampleActionGroup.id())
 *                         .build())
 *                     .alertResolution(AlertPrometheusRuleGroupRuleAlertResolutionArgs.builder()
 *                         .autoResolved(true)
 *                         .timeToResolve("PT10M")
 *                         .build())
 *                     .annotations(Map.of("annotationName", "annotationValue"))
 *                     .labels(Map.of("team", "prod"))
 *                     .build())
 *             .tags(Map.of("key", "value"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleActionGroup:
 *     type: azure:monitoring:ActionGroup
 *     name: example
 *     properties:
 *       name: example-mag
 *       resourceGroupName: ${example.name}
 *       shortName: testag
 *   exampleWorkspace:
 *     type: azure:monitoring:Workspace
 *     name: example
 *     properties:
 *       name: example-amw
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *   exampleKubernetesCluster:
 *     type: azure:containerservice:KubernetesCluster
 *     name: example
 *     properties:
 *       name: example-cluster
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       dnsPrefix: example-aks
 *       defaultNodePool:
 *         name: default
 *         nodeCount: 1
 *         vmSize: Standard_DS2_v2
 *         enableHostEncryption: true
 *       identity:
 *         type: SystemAssigned
 *   exampleAlertPrometheusRuleGroup:
 *     type: azure:monitoring:AlertPrometheusRuleGroup
 *     name: example
 *     properties:
 *       name: example-amprg
 *       location: West Europe
 *       resourceGroupName: ${example.name}
 *       clusterName: ${exampleKubernetesCluster.name}
 *       description: This is the description of the following rule group
 *       ruleGroupEnabled: false
 *       interval: PT1M
 *       scopes:
 *         - ${exampleWorkspace.id}
 *       rules:
 *         - enabled: false
 *           expression: |
 *             histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service="billing-processing"}[5m])) by (job_type))
 *           record: job_type:billing_jobs_duration_seconds:99p5m
 *           labels:
 *             team: prod
 *         - alert: Billing_Processing_Very_Slow
 *           enabled: true
 *           expression: |
 *             histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service="billing-processing"}[5m])) by (job_type))
 *           for: PT5M
 *           severity: 2
 *           actions:
 *             - actionGroupId: ${exampleActionGroup.id}
 *           alertResolution:
 *             autoResolved: true
 *             timeToResolve: PT10M
 *           annotations:
 *             annotationName: annotationValue
 *           labels:
 *             team: prod
 *       tags:
 *         key: value
 * ```
 * 
 * ## Import
 * Alert Management Prometheus Rule Group can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:monitoring/alertPrometheusRuleGroup:AlertPrometheusRuleGroup example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.AlertsManagement/prometheusRuleGroups/ruleGroup1
 * ```
 * @property clusterName Specifies the name of the Managed Kubernetes Cluster.
 * @property description The description of the Alert Management Prometheus Rule Group.
 * @property interval Specifies the interval in which to run the Alert Management Prometheus Rule Group represented in ISO 8601 duration format. Possible values are between `PT1M` and `PT15M`.
 * @property location Specifies the Azure Region where the Alert Management Prometheus Rule Group should exist. Changing this forces a new resource to be created.
 * @property name Specifies the name which should be used for this Alert Management Prometheus Rule Group. Changing this forces a new resource to be created.
 * @property resourceGroupName Specifies the name of the Resource Group where the Alert Management Prometheus Rule Group should exist. Changing this forces a new resource to be created.
 * @property ruleGroupEnabled Is this Alert Management Prometheus Rule Group enabled? Possible values are `true` and `false`.
 * @property rules A `rule` block as defined below.
 * @property scopes Specifies the resource ID of the Azure Monitor Workspace.
 * @property tags A mapping of tags to assign to the Alert Management Prometheus Rule Group.
 */
public data class AlertPrometheusRuleGroupArgs(
    public val clusterName: Output? = null,
    public val description: Output? = null,
    public val interval: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val resourceGroupName: Output? = null,
    public val ruleGroupEnabled: Output? = null,
    public val rules: Output>? = null,
    public val scopes: Output>? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.monitoring.AlertPrometheusRuleGroupArgs =
        com.pulumi.azure.monitoring.AlertPrometheusRuleGroupArgs.builder()
            .clusterName(clusterName?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .interval(interval?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .ruleGroupEnabled(ruleGroupEnabled?.applyValue({ args0 -> args0 }))
            .rules(rules?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .scopes(scopes?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [AlertPrometheusRuleGroupArgs].
 */
@PulumiTagMarker
public class AlertPrometheusRuleGroupArgsBuilder internal constructor() {
    private var clusterName: Output? = null

    private var description: Output? = null

    private var interval: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var resourceGroupName: Output? = null

    private var ruleGroupEnabled: Output? = null

    private var rules: Output>? = null

    private var scopes: Output>? = null

    private var tags: Output>? = null

    /**
     * @param value Specifies the name of the Managed Kubernetes Cluster.
     */
    @JvmName("rpjnfrspixbkdscr")
    public suspend fun clusterName(`value`: Output) {
        this.clusterName = value
    }

    /**
     * @param value The description of the Alert Management Prometheus Rule Group.
     */
    @JvmName("wmvxfoodlxsokadk")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Specifies the interval in which to run the Alert Management Prometheus Rule Group represented in ISO 8601 duration format. Possible values are between `PT1M` and `PT15M`.
     */
    @JvmName("ewdvxbjkyphxlmlw")
    public suspend fun interval(`value`: Output) {
        this.interval = value
    }

    /**
     * @param value Specifies the Azure Region where the Alert Management Prometheus Rule Group should exist. Changing this forces a new resource to be created.
     */
    @JvmName("pkwlxrxxxwrsnvhb")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value Specifies the name which should be used for this Alert Management Prometheus Rule Group. Changing this forces a new resource to be created.
     */
    @JvmName("tajfemywsedntnfq")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Specifies the name of the Resource Group where the Alert Management Prometheus Rule Group should exist. Changing this forces a new resource to be created.
     */
    @JvmName("edfcttvvwitrsana")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Is this Alert Management Prometheus Rule Group enabled? Possible values are `true` and `false`.
     */
    @JvmName("mlmmdwvgygtxfepa")
    public suspend fun ruleGroupEnabled(`value`: Output) {
        this.ruleGroupEnabled = value
    }

    /**
     * @param value A `rule` block as defined below.
     */
    @JvmName("ineqabvbcicftngn")
    public suspend fun rules(`value`: Output>) {
        this.rules = value
    }

    @JvmName("uftwbdjciaqnjjbv")
    public suspend fun rules(vararg values: Output) {
        this.rules = Output.all(values.asList())
    }

    /**
     * @param values A `rule` block as defined below.
     */
    @JvmName("uedajyosmrshtafe")
    public suspend fun rules(values: List>) {
        this.rules = Output.all(values)
    }

    /**
     * @param value Specifies the resource ID of the Azure Monitor Workspace.
     */
    @JvmName("aunicdsoxpwrnvjf")
    public suspend fun scopes(`value`: Output>) {
        this.scopes = value
    }

    @JvmName("yoqgpuflpakafvbr")
    public suspend fun scopes(vararg values: Output) {
        this.scopes = Output.all(values.asList())
    }

    /**
     * @param values Specifies the resource ID of the Azure Monitor Workspace.
     */
    @JvmName("ewwmmsjkfkxtwsjj")
    public suspend fun scopes(values: List>) {
        this.scopes = Output.all(values)
    }

    /**
     * @param value A mapping of tags to assign to the Alert Management Prometheus Rule Group.
     */
    @JvmName("avjembtkbhjckbvs")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value Specifies the name of the Managed Kubernetes Cluster.
     */
    @JvmName("thgpmymkgkiuatmn")
    public suspend fun clusterName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.clusterName = mapped
    }

    /**
     * @param value The description of the Alert Management Prometheus Rule Group.
     */
    @JvmName("briesdbleukqstoj")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Specifies the interval in which to run the Alert Management Prometheus Rule Group represented in ISO 8601 duration format. Possible values are between `PT1M` and `PT15M`.
     */
    @JvmName("gcwhrslvqkwfrebx")
    public suspend fun interval(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.interval = mapped
    }

    /**
     * @param value Specifies the Azure Region where the Alert Management Prometheus Rule Group should exist. Changing this forces a new resource to be created.
     */
    @JvmName("heqwrnlpghorxdpj")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value Specifies the name which should be used for this Alert Management Prometheus Rule Group. Changing this forces a new resource to be created.
     */
    @JvmName("cpacpylevtkeiqsn")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Specifies the name of the Resource Group where the Alert Management Prometheus Rule Group should exist. Changing this forces a new resource to be created.
     */
    @JvmName("hjubccqegglrhrqg")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value Is this Alert Management Prometheus Rule Group enabled? Possible values are `true` and `false`.
     */
    @JvmName("ajesswvrhqlxwtjs")
    public suspend fun ruleGroupEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ruleGroupEnabled = mapped
    }

    /**
     * @param value A `rule` block as defined below.
     */
    @JvmName("whacgnuykklxuxpe")
    public suspend fun rules(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.rules = mapped
    }

    /**
     * @param argument A `rule` block as defined below.
     */
    @JvmName("qfdyfvtttdntjtan")
    public suspend
    fun rules(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            AlertPrometheusRuleGroupRuleArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.rules = mapped
    }

    /**
     * @param argument A `rule` block as defined below.
     */
    @JvmName("mwbwiphrigkaasyx")
    public suspend fun rules(
        vararg
        argument: suspend AlertPrometheusRuleGroupRuleArgsBuilder.() -> Unit,
    ) {
        val toBeMapped = argument.toList().map {
            AlertPrometheusRuleGroupRuleArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.rules = mapped
    }

    /**
     * @param argument A `rule` block as defined below.
     */
    @JvmName("wyuiysynnomnjeev")
    public suspend fun rules(argument: suspend AlertPrometheusRuleGroupRuleArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            AlertPrometheusRuleGroupRuleArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.rules = mapped
    }

    /**
     * @param values A `rule` block as defined below.
     */
    @JvmName("ghooxgjwngeaublk")
    public suspend fun rules(vararg values: AlertPrometheusRuleGroupRuleArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.rules = mapped
    }

    /**
     * @param value Specifies the resource ID of the Azure Monitor Workspace.
     */
    @JvmName("leoiumhhcciawqip")
    public suspend fun scopes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scopes = mapped
    }

    /**
     * @param values Specifies the resource ID of the Azure Monitor Workspace.
     */
    @JvmName("hwxgrcupyelnbmaa")
    public suspend fun scopes(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.scopes = mapped
    }

    /**
     * @param value A mapping of tags to assign to the Alert Management Prometheus Rule Group.
     */
    @JvmName("fucyywtwifslqxgr")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags to assign to the Alert Management Prometheus Rule Group.
     */
    @JvmName("hdqcjrhprmhwxuhd")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): AlertPrometheusRuleGroupArgs = AlertPrometheusRuleGroupArgs(
        clusterName = clusterName,
        description = description,
        interval = interval,
        location = location,
        name = name,
        resourceGroupName = resourceGroupName,
        ruleGroupEnabled = ruleGroupEnabled,
        rules = rules,
        scopes = scopes,
        tags = tags,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy