![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.azurenative.insights.kotlin.AlertRuleArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-native-kotlin Show documentation
Show all versions of pulumi-azure-native-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azurenative.insights.kotlin
import com.pulumi.azurenative.insights.AlertRuleArgs.builder
import com.pulumi.azurenative.insights.kotlin.inputs.RuleEmailActionArgs
import com.pulumi.azurenative.insights.kotlin.inputs.RuleWebhookActionArgs
import com.pulumi.core.Either
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Any
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* The alert rule resource.
* Azure REST API version: 2016-03-01. Prior API version in Azure Native 1.x: 2016-03-01.
* ## Example Usage
* ### Create or update an alert rule
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using AzureNative = Pulumi.AzureNative;
* return await Deployment.RunAsync(() =>
* {
* var alertRule = new AzureNative.Insights.AlertRule("alertRule", new()
* {
* Actions = new[] {},
* Condition = new AzureNative.Insights.Inputs.ThresholdRuleConditionArgs
* {
* DataSource = new AzureNative.Insights.Inputs.RuleMetricDataSourceArgs
* {
* MetricName = "Requests",
* OdataType = "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource",
* ResourceUri = "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest",
* },
* OdataType = "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition",
* Operator = AzureNative.Insights.ConditionOperator.GreaterThan,
* Threshold = 3,
* TimeAggregation = AzureNative.Insights.TimeAggregationOperator.Total,
* WindowSize = "PT5M",
* },
* Description = "Pura Vida",
* IsEnabled = true,
* Location = "West US",
* Name = "chiricutin",
* ResourceGroupName = "Rac46PostSwapRG",
* RuleName = "chiricutin",
* Tags = null,
* });
* });
* ```
* ```go
* package main
* import (
* insights "github.com/pulumi/pulumi-azure-native-sdk/insights/v2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := insights.NewAlertRule(ctx, "alertRule", &insights.AlertRuleArgs{
* Actions: pulumi.Array{},
* Condition: &insights.ThresholdRuleConditionArgs{
* DataSource: insights.RuleMetricDataSource{
* MetricName: "Requests",
* OdataType: "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource",
* ResourceUri: "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest",
* },
* OdataType: pulumi.String("Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition"),
* Operator: insights.ConditionOperatorGreaterThan,
* Threshold: pulumi.Float64(3),
* TimeAggregation: insights.TimeAggregationOperatorTotal,
* WindowSize: pulumi.String("PT5M"),
* },
* Description: pulumi.String("Pura Vida"),
* IsEnabled: pulumi.Bool(true),
* Location: pulumi.String("West US"),
* Name: pulumi.String("chiricutin"),
* ResourceGroupName: pulumi.String("Rac46PostSwapRG"),
* RuleName: pulumi.String("chiricutin"),
* Tags: nil,
* })
* 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.azurenative.insights.AlertRule;
* import com.pulumi.azurenative.insights.AlertRuleArgs;
* 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 alertRule = new AlertRule("alertRule", AlertRuleArgs.builder()
* .actions()
* .condition(LocationThresholdRuleConditionArgs.builder()
* .dataSource(RuleManagementEventDataSourceArgs.builder()
* .metricName("Requests")
* .odataType("Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource")
* .resourceUri("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest")
* .build())
* .odataType("Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition")
* .operator("GreaterThan")
* .threshold(3)
* .timeAggregation("Total")
* .windowSize("PT5M")
* .build())
* .description("Pura Vida")
* .isEnabled(true)
* .location("West US")
* .name("chiricutin")
* .resourceGroupName("Rac46PostSwapRG")
* .ruleName("chiricutin")
* .tags()
* .build());
* }
* }
* ```
* ## Import
* An existing resource can be imported using its type token, name, and identifier, e.g.
* ```sh
* $ pulumi import azure-native:insights:AlertRule chiricutin /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}
* ```
* @property action action that is performed when the alert rule becomes active, and when an alert condition is resolved.
* @property actions the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
* @property condition the condition that results in the alert rule being activated.
* @property description the description of the alert rule that will be included in the alert email.
* @property isEnabled the flag that indicates whether the alert rule is enabled.
* @property location Resource location
* @property name the name of the alert rule.
* @property provisioningState the provisioning state.
* @property resourceGroupName The name of the resource group. The name is case insensitive.
* @property ruleName The name of the rule.
* @property tags Resource tags
*/
public data class AlertRuleArgs(
public val action: Output>? = null,
public val actions: Output>>? = null,
public val condition: Output? = null,
public val description: Output? = null,
public val isEnabled: Output? = null,
public val location: Output? = null,
public val name: Output? = null,
public val provisioningState: Output? = null,
public val resourceGroupName: Output? = null,
public val ruleName: Output? = null,
public val tags: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy