AlertArgs

data class AlertArgs(val alertName: Output<String>? = null, val alertRuleProperties: Output<AlertRulePropertiesArgs>? = null, val monitorName: Output<String>? = null, val providerNames: Output<List<String>>? = null, val providerType: Output<String>? = null, val resourceGroupName: Output<String>? = null, val templateName: Output<String>? = null) : ConvertibleToJava<AlertArgs>

A alert associated with SAP monitor. Uses Azure REST API version 2024-02-01-preview. In version 2.x of the Azure Native provider, it used API version 2024-02-01-preview.

Example Usage

Creates an Alert

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var alert = new AzureNative.Workloads.Alert("alert", new()
{
AlertName = "myAlert",
AlertRuleProperties = new AzureNative.Workloads.Inputs.AlertRulePropertiesArgs
{
ActionGroups = new[]
{
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.insights/actiongroups/actiongroup1",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.insights/actiongroups/actiongroup2",
},
AlertQueryParameters = new[]
{
new AzureNative.Workloads.Inputs.AlertQueryParameterArgs
{
Name = "providerInstance",
Value = "",
},
new AzureNative.Workloads.Inputs.AlertQueryParameterArgs
{
Name = "workType",
Value = "",
},
},
AutoMitigate = AzureNative.Workloads.AlertAutoMitigate.Disable,
Dimension = "cpu",
EvaluationFrequency = 5,
FailingPeriodsOperator = AzureNative.Workloads.ConditionalOperator.GreaterThan,
FailingPeriodsToAlert = 3,
MuteActionsDuration = 0,
Severity = 3,
Status = AzureNative.Workloads.AlertRuleStatus.Enabled,
Threshold = 80,
ThresholdOperator = AzureNative.Workloads.ConditionalOperator.GreaterThan,
WindowSize = 15,
},
MonitorName = "mySapMonitor",
ProviderNames = new[]
{
"hana-provider-1",
"hana-provider-2",
},
ProviderType = "SapHana",
ResourceGroupName = "myResourceGroup",
TemplateName = "saphana-cpu-memory-health",
});
});
package main
import (
workloads "github.com/pulumi/pulumi-azure-native-sdk/workloads/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := workloads.NewAlert(ctx, "alert", &workloads.AlertArgs{
AlertName: pulumi.String("myAlert"),
AlertRuleProperties: &workloads.AlertRulePropertiesArgs{
ActionGroups: pulumi.StringArray{
pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.insights/actiongroups/actiongroup1"),
pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.insights/actiongroups/actiongroup2"),
},
AlertQueryParameters: workloads.AlertQueryParameterArray{
&workloads.AlertQueryParameterArgs{
Name: pulumi.String("providerInstance"),
Value: pulumi.String(""),
},
&workloads.AlertQueryParameterArgs{
Name: pulumi.String("workType"),
Value: pulumi.String(""),
},
},
AutoMitigate: pulumi.String(workloads.AlertAutoMitigateDisable),
Dimension: pulumi.String("cpu"),
EvaluationFrequency: pulumi.Int(5),
FailingPeriodsOperator: pulumi.String(workloads.ConditionalOperatorGreaterThan),
FailingPeriodsToAlert: pulumi.Int(3),
MuteActionsDuration: pulumi.Int(0),
Severity: pulumi.Int(3),
Status: pulumi.String(workloads.AlertRuleStatusEnabled),
Threshold: pulumi.Int(80),
ThresholdOperator: pulumi.String(workloads.ConditionalOperatorGreaterThan),
WindowSize: pulumi.Int(15),
},
MonitorName: pulumi.String("mySapMonitor"),
ProviderNames: pulumi.StringArray{
pulumi.String("hana-provider-1"),
pulumi.String("hana-provider-2"),
},
ProviderType: pulumi.String("SapHana"),
ResourceGroupName: pulumi.String("myResourceGroup"),
TemplateName: pulumi.String("saphana-cpu-memory-health"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.workloads.Alert;
import com.pulumi.azurenative.workloads.AlertArgs;
import com.pulumi.azurenative.workloads.inputs.AlertRulePropertiesArgs;
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 alert = new Alert("alert", AlertArgs.builder()
.alertName("myAlert")
.alertRuleProperties(AlertRulePropertiesArgs.builder()
.actionGroups(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.insights/actiongroups/actiongroup1",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.insights/actiongroups/actiongroup2")
.alertQueryParameters(
AlertQueryParameterArgs.builder()
.name("providerInstance")
.value("")
.build(),
AlertQueryParameterArgs.builder()
.name("workType")
.value("")
.build())
.autoMitigate("Disable")
.dimension("cpu")
.evaluationFrequency(5)
.failingPeriodsOperator("GreaterThan")
.failingPeriodsToAlert(3)
.muteActionsDuration(0)
.severity(3)
.status("Enabled")
.threshold(80)
.thresholdOperator("GreaterThan")
.windowSize(15)
.build())
.monitorName("mySapMonitor")
.providerNames(
"hana-provider-1",
"hana-provider-2")
.providerType("SapHana")
.resourceGroupName("myResourceGroup")
.templateName("saphana-cpu-memory-health")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:workloads:Alert myAlert /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/alerts/{alertName}

Constructors

Link copied to clipboard
constructor(alertName: Output<String>? = null, alertRuleProperties: Output<AlertRulePropertiesArgs>? = null, monitorName: Output<String>? = null, providerNames: Output<List<String>>? = null, providerType: Output<String>? = null, resourceGroupName: Output<String>? = null, templateName: Output<String>? = null)

Properties

Link copied to clipboard
val alertName: Output<String>? = null

Name of the SAP monitor alert resource.

Link copied to clipboard

Describes the properties of an alert.

Link copied to clipboard
val monitorName: Output<String>? = null

Name of the SAP monitor resource.

Link copied to clipboard
val providerNames: Output<List<String>>? = null

Name of provider instances associated with the alert.

Link copied to clipboard
val providerType: Output<String>? = null

The provider type for alert. For example, the value can be SapHana.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group. The name is case insensitive.

Link copied to clipboard
val templateName: Output<String>? = null

Name of the alert template from which it was created.

Functions

Link copied to clipboard
open override fun toJava(): AlertArgs