Alert

class Alert : KotlinCustomResource

A alert associated with SAP monitor. Uses Azure REST 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}

Properties

Link copied to clipboard

Describes the properties of an alert.

Link copied to clipboard

ID of the alert rule resource created.

Link copied to clipboard

Defines the alert instance errors.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

The name of the resource

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

Name of provider instances associated with the alert.

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

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

Link copied to clipboard

State of provisioning of the alert instance

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Azure Resource Manager metadata containing createdBy and modifiedBy information.

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

Name of the alert template from which it was created.

Link copied to clipboard
val type: Output<String>

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Link copied to clipboard
val urn: Output<String>