azure-native.insights.MetricAlert
Explore with Pulumi AI
The metric alert resource. API Version: 2018-03-01.
Example Usage
Create or update a dynamic alert rule for Multiple Resources
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var metricAlert = new AzureNative.Insights.MetricAlert("metricAlert", new()
{
Actions = new[]
{
new AzureNative.Insights.Inputs.MetricAlertActionArgs
{
ActionGroupId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
WebHookProperties =
{
{ "key11", "value11" },
{ "key12", "value12" },
},
},
},
AutoMitigate = true,
Criteria = new AzureNative.Insights.Inputs.MetricAlertMultipleResourceMultipleMetricCriteriaArgs
{
AllOf = new[]
{
new AzureNative.Insights.Inputs.DynamicMetricCriteriaArgs
{
AlertSensitivity = "Medium",
CriterionType = "DynamicThresholdCriterion",
Dimensions = new[] {},
FailingPeriods = new AzureNative.Insights.Inputs.DynamicThresholdFailingPeriodsArgs
{
MinFailingPeriodsToAlert = 4,
NumberOfEvaluationPeriods = 4,
},
MetricName = "Percentage CPU",
MetricNamespace = "microsoft.compute/virtualmachines",
Name = "High_CPU_80",
Operator = "GreaterOrLessThan",
TimeAggregation = "Average",
},
},
OdataType = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
},
Description = "This is the description of the rule1",
Enabled = true,
EvaluationFrequency = "PT1M",
Location = "global",
ResourceGroupName = "gigtest",
RuleName = "MetricAlertOnMultipleResources",
Scopes = new[]
{
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2",
},
Severity = 3,
Tags = null,
TargetResourceRegion = "southcentralus",
TargetResourceType = "Microsoft.Compute/virtualMachines",
WindowSize = "PT15M",
});
});
package main
import (
insights "github.com/pulumi/pulumi-azure-native-sdk/insights"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := insights.NewMetricAlert(ctx, "metricAlert", &insights.MetricAlertArgs{
Actions: []insights.MetricAlertActionArgs{
{
ActionGroupId: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
WebHookProperties: {
"key11": pulumi.String("value11"),
"key12": pulumi.String("value12"),
},
},
},
AutoMitigate: pulumi.Bool(true),
Criteria: insights.MetricAlertMultipleResourceMultipleMetricCriteria{
AllOf: []interface{}{
insights.DynamicMetricCriteria{
AlertSensitivity: "Medium",
CriterionType: "DynamicThresholdCriterion",
Dimensions: []insights.MetricDimension{},
FailingPeriods: insights.DynamicThresholdFailingPeriods{
MinFailingPeriodsToAlert: 4,
NumberOfEvaluationPeriods: 4,
},
MetricName: "Percentage CPU",
MetricNamespace: "microsoft.compute/virtualmachines",
Name: "High_CPU_80",
Operator: "GreaterOrLessThan",
TimeAggregation: "Average",
},
},
OdataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
},
Description: pulumi.String("This is the description of the rule1"),
Enabled: pulumi.Bool(true),
EvaluationFrequency: pulumi.String("PT1M"),
Location: pulumi.String("global"),
ResourceGroupName: pulumi.String("gigtest"),
RuleName: pulumi.String("MetricAlertOnMultipleResources"),
Scopes: pulumi.StringArray{
pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1"),
pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2"),
},
Severity: pulumi.Int(3),
Tags: nil,
TargetResourceRegion: pulumi.String("southcentralus"),
TargetResourceType: pulumi.String("Microsoft.Compute/virtualMachines"),
WindowSize: pulumi.String("PT15M"),
})
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.insights.MetricAlert;
import com.pulumi.azurenative.insights.MetricAlertArgs;
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 metricAlert = new MetricAlert("metricAlert", MetricAlertArgs.builder()
.actions(Map.ofEntries(
Map.entry("actionGroupId", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
Map.entry("webHookProperties", Map.ofEntries(
Map.entry("key11", "value11"),
Map.entry("key12", "value12")
))
))
.autoMitigate(true)
.criteria(Map.ofEntries(
Map.entry("allOf", Map.ofEntries(
Map.entry("alertSensitivity", "Medium"),
Map.entry("criterionType", "DynamicThresholdCriterion"),
Map.entry("dimensions", ),
Map.entry("failingPeriods", Map.ofEntries(
Map.entry("minFailingPeriodsToAlert", 4),
Map.entry("numberOfEvaluationPeriods", 4)
)),
Map.entry("metricName", "Percentage CPU"),
Map.entry("metricNamespace", "microsoft.compute/virtualmachines"),
Map.entry("name", "High_CPU_80"),
Map.entry("operator", "GreaterOrLessThan"),
Map.entry("timeAggregation", "Average")
)),
Map.entry("odataType", "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria")
))
.description("This is the description of the rule1")
.enabled(true)
.evaluationFrequency("PT1M")
.location("global")
.resourceGroupName("gigtest")
.ruleName("MetricAlertOnMultipleResources")
.scopes(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2")
.severity(3)
.tags()
.targetResourceRegion("southcentralus")
.targetResourceType("Microsoft.Compute/virtualMachines")
.windowSize("PT15M")
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
metric_alert = azure_native.insights.MetricAlert("metricAlert",
actions=[azure_native.insights.MetricAlertActionArgs(
action_group_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
web_hook_properties={
"key11": "value11",
"key12": "value12",
},
)],
auto_mitigate=True,
criteria=azure_native.insights.MetricAlertMultipleResourceMultipleMetricCriteriaArgs(
all_of=[azure_native.insights.DynamicMetricCriteriaArgs(
alert_sensitivity="Medium",
criterion_type="DynamicThresholdCriterion",
dimensions=[],
failing_periods=azure_native.insights.DynamicThresholdFailingPeriodsArgs(
min_failing_periods_to_alert=4,
number_of_evaluation_periods=4,
),
metric_name="Percentage CPU",
metric_namespace="microsoft.compute/virtualmachines",
name="High_CPU_80",
operator="GreaterOrLessThan",
time_aggregation="Average",
)],
odata_type="Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
),
description="This is the description of the rule1",
enabled=True,
evaluation_frequency="PT1M",
location="global",
resource_group_name="gigtest",
rule_name="MetricAlertOnMultipleResources",
scopes=[
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2",
],
severity=3,
tags={},
target_resource_region="southcentralus",
target_resource_type="Microsoft.Compute/virtualMachines",
window_size="PT15M")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const metricAlert = new azure_native.insights.MetricAlert("metricAlert", {
actions: [{
actionGroupId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
webHookProperties: {
key11: "value11",
key12: "value12",
},
}],
autoMitigate: true,
criteria: {
allOf: [{
alertSensitivity: "Medium",
criterionType: "DynamicThresholdCriterion",
dimensions: [],
failingPeriods: {
minFailingPeriodsToAlert: 4,
numberOfEvaluationPeriods: 4,
},
metricName: "Percentage CPU",
metricNamespace: "microsoft.compute/virtualmachines",
name: "High_CPU_80",
operator: "GreaterOrLessThan",
timeAggregation: "Average",
}],
odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
},
description: "This is the description of the rule1",
enabled: true,
evaluationFrequency: "PT1M",
location: "global",
resourceGroupName: "gigtest",
ruleName: "MetricAlertOnMultipleResources",
scopes: [
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2",
],
severity: 3,
tags: {},
targetResourceRegion: "southcentralus",
targetResourceType: "Microsoft.Compute/virtualMachines",
windowSize: "PT15M",
});
resources:
metricAlert:
type: azure-native:insights:MetricAlert
properties:
actions:
- actionGroupId: /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2
webHookProperties:
key11: value11
key12: value12
autoMitigate: true
criteria:
allOf:
- alertSensitivity: Medium
criterionType: DynamicThresholdCriterion
dimensions: []
failingPeriods:
minFailingPeriodsToAlert: 4
numberOfEvaluationPeriods: 4
metricName: Percentage CPU
metricNamespace: microsoft.compute/virtualmachines
name: High_CPU_80
operator: GreaterOrLessThan
timeAggregation: Average
odataType: Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria
description: This is the description of the rule1
enabled: true
evaluationFrequency: PT1M
location: global
resourceGroupName: gigtest
ruleName: MetricAlertOnMultipleResources
scopes:
- /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1
- /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2
severity: 3
tags: {}
targetResourceRegion: southcentralus
targetResourceType: Microsoft.Compute/virtualMachines
windowSize: PT15M
Create or update a dynamic alert rule for Single Resource
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var metricAlert = new AzureNative.Insights.MetricAlert("metricAlert", new()
{
Actions = new[]
{
new AzureNative.Insights.Inputs.MetricAlertActionArgs
{
ActionGroupId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
WebHookProperties =
{
{ "key11", "value11" },
{ "key12", "value12" },
},
},
},
AutoMitigate = true,
Criteria = new AzureNative.Insights.Inputs.MetricAlertMultipleResourceMultipleMetricCriteriaArgs
{
AllOf = new[]
{
new AzureNative.Insights.Inputs.DynamicMetricCriteriaArgs
{
AlertSensitivity = "Medium",
CriterionType = "DynamicThresholdCriterion",
Dimensions = new[] {},
FailingPeriods = new AzureNative.Insights.Inputs.DynamicThresholdFailingPeriodsArgs
{
MinFailingPeriodsToAlert = 4,
NumberOfEvaluationPeriods = 4,
},
IgnoreDataBefore = "2019-04-04T21:00:00.000Z",
MetricName = "Percentage CPU",
MetricNamespace = "microsoft.compute/virtualmachines",
Name = "High_CPU_80",
Operator = "GreaterOrLessThan",
TimeAggregation = "Average",
},
},
OdataType = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
},
Description = "This is the description of the rule1",
Enabled = true,
EvaluationFrequency = "PT1M",
Location = "global",
ResourceGroupName = "gigtest",
RuleName = "chiricutin",
Scopes = new[]
{
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme",
},
Severity = 3,
Tags = null,
WindowSize = "PT15M",
});
});
package main
import (
insights "github.com/pulumi/pulumi-azure-native-sdk/insights"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := insights.NewMetricAlert(ctx, "metricAlert", &insights.MetricAlertArgs{
Actions: []insights.MetricAlertActionArgs{
{
ActionGroupId: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
WebHookProperties: {
"key11": pulumi.String("value11"),
"key12": pulumi.String("value12"),
},
},
},
AutoMitigate: pulumi.Bool(true),
Criteria: insights.MetricAlertMultipleResourceMultipleMetricCriteria{
AllOf: []interface{}{
insights.DynamicMetricCriteria{
AlertSensitivity: "Medium",
CriterionType: "DynamicThresholdCriterion",
Dimensions: []insights.MetricDimension{},
FailingPeriods: insights.DynamicThresholdFailingPeriods{
MinFailingPeriodsToAlert: 4,
NumberOfEvaluationPeriods: 4,
},
IgnoreDataBefore: "2019-04-04T21:00:00.000Z",
MetricName: "Percentage CPU",
MetricNamespace: "microsoft.compute/virtualmachines",
Name: "High_CPU_80",
Operator: "GreaterOrLessThan",
TimeAggregation: "Average",
},
},
OdataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
},
Description: pulumi.String("This is the description of the rule1"),
Enabled: pulumi.Bool(true),
EvaluationFrequency: pulumi.String("PT1M"),
Location: pulumi.String("global"),
ResourceGroupName: pulumi.String("gigtest"),
RuleName: pulumi.String("chiricutin"),
Scopes: pulumi.StringArray{
pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme"),
},
Severity: pulumi.Int(3),
Tags: nil,
WindowSize: pulumi.String("PT15M"),
})
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.insights.MetricAlert;
import com.pulumi.azurenative.insights.MetricAlertArgs;
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 metricAlert = new MetricAlert("metricAlert", MetricAlertArgs.builder()
.actions(Map.ofEntries(
Map.entry("actionGroupId", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
Map.entry("webHookProperties", Map.ofEntries(
Map.entry("key11", "value11"),
Map.entry("key12", "value12")
))
))
.autoMitigate(true)
.criteria(Map.ofEntries(
Map.entry("allOf", Map.ofEntries(
Map.entry("alertSensitivity", "Medium"),
Map.entry("criterionType", "DynamicThresholdCriterion"),
Map.entry("dimensions", ),
Map.entry("failingPeriods", Map.ofEntries(
Map.entry("minFailingPeriodsToAlert", 4),
Map.entry("numberOfEvaluationPeriods", 4)
)),
Map.entry("ignoreDataBefore", "2019-04-04T21:00:00.000Z"),
Map.entry("metricName", "Percentage CPU"),
Map.entry("metricNamespace", "microsoft.compute/virtualmachines"),
Map.entry("name", "High_CPU_80"),
Map.entry("operator", "GreaterOrLessThan"),
Map.entry("timeAggregation", "Average")
)),
Map.entry("odataType", "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria")
))
.description("This is the description of the rule1")
.enabled(true)
.evaluationFrequency("PT1M")
.location("global")
.resourceGroupName("gigtest")
.ruleName("chiricutin")
.scopes("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme")
.severity(3)
.tags()
.windowSize("PT15M")
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
metric_alert = azure_native.insights.MetricAlert("metricAlert",
actions=[azure_native.insights.MetricAlertActionArgs(
action_group_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
web_hook_properties={
"key11": "value11",
"key12": "value12",
},
)],
auto_mitigate=True,
criteria=azure_native.insights.MetricAlertMultipleResourceMultipleMetricCriteriaArgs(
all_of=[azure_native.insights.DynamicMetricCriteriaArgs(
alert_sensitivity="Medium",
criterion_type="DynamicThresholdCriterion",
dimensions=[],
failing_periods=azure_native.insights.DynamicThresholdFailingPeriodsArgs(
min_failing_periods_to_alert=4,
number_of_evaluation_periods=4,
),
ignore_data_before="2019-04-04T21:00:00.000Z",
metric_name="Percentage CPU",
metric_namespace="microsoft.compute/virtualmachines",
name="High_CPU_80",
operator="GreaterOrLessThan",
time_aggregation="Average",
)],
odata_type="Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
),
description="This is the description of the rule1",
enabled=True,
evaluation_frequency="PT1M",
location="global",
resource_group_name="gigtest",
rule_name="chiricutin",
scopes=["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme"],
severity=3,
tags={},
window_size="PT15M")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const metricAlert = new azure_native.insights.MetricAlert("metricAlert", {
actions: [{
actionGroupId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
webHookProperties: {
key11: "value11",
key12: "value12",
},
}],
autoMitigate: true,
criteria: {
allOf: [{
alertSensitivity: "Medium",
criterionType: "DynamicThresholdCriterion",
dimensions: [],
failingPeriods: {
minFailingPeriodsToAlert: 4,
numberOfEvaluationPeriods: 4,
},
ignoreDataBefore: "2019-04-04T21:00:00.000Z",
metricName: "Percentage CPU",
metricNamespace: "microsoft.compute/virtualmachines",
name: "High_CPU_80",
operator: "GreaterOrLessThan",
timeAggregation: "Average",
}],
odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
},
description: "This is the description of the rule1",
enabled: true,
evaluationFrequency: "PT1M",
location: "global",
resourceGroupName: "gigtest",
ruleName: "chiricutin",
scopes: ["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme"],
severity: 3,
tags: {},
windowSize: "PT15M",
});
resources:
metricAlert:
type: azure-native:insights:MetricAlert
properties:
actions:
- actionGroupId: /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2
webHookProperties:
key11: value11
key12: value12
autoMitigate: true
criteria:
allOf:
- alertSensitivity: Medium
criterionType: DynamicThresholdCriterion
dimensions: []
failingPeriods:
minFailingPeriodsToAlert: 4
numberOfEvaluationPeriods: 4
ignoreDataBefore: 2019-04-04T21:00:00.000Z
metricName: Percentage CPU
metricNamespace: microsoft.compute/virtualmachines
name: High_CPU_80
operator: GreaterOrLessThan
timeAggregation: Average
odataType: Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria
description: This is the description of the rule1
enabled: true
evaluationFrequency: PT1M
location: global
resourceGroupName: gigtest
ruleName: chiricutin
scopes:
- /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme
severity: 3
tags: {}
windowSize: PT15M
Create or update a web test alert rule
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var metricAlert = new AzureNative.Insights.MetricAlert("metricAlert", new()
{
Actions = new[] {},
Criteria = new AzureNative.Insights.Inputs.WebtestLocationAvailabilityCriteriaArgs
{
ComponentId = "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example",
FailedLocationCount = 2,
OdataType = "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria",
WebTestId = "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example",
},
Description = "Automatically created alert rule for availability test \"component-example\" a",
Enabled = true,
EvaluationFrequency = "PT1M",
Location = "global",
ResourceGroupName = "rg-example",
RuleName = "webtest-name-example",
Scopes = new[]
{
"/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example",
"/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example",
},
Severity = 4,
Tags =
{
{ "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example", "Resource" },
{ "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example", "Resource" },
},
WindowSize = "PT15M",
});
});
package main
import (
insights "github.com/pulumi/pulumi-azure-native-sdk/insights"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := insights.NewMetricAlert(ctx, "metricAlert", &insights.MetricAlertArgs{
Actions: insights.MetricAlertActionArray{},
Criteria: insights.WebtestLocationAvailabilityCriteria{
ComponentId: "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example",
FailedLocationCount: 2,
OdataType: "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria",
WebTestId: "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example",
},
Description: pulumi.String("Automatically created alert rule for availability test \"component-example\" a"),
Enabled: pulumi.Bool(true),
EvaluationFrequency: pulumi.String("PT1M"),
Location: pulumi.String("global"),
ResourceGroupName: pulumi.String("rg-example"),
RuleName: pulumi.String("webtest-name-example"),
Scopes: pulumi.StringArray{
pulumi.String("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example"),
pulumi.String("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example"),
},
Severity: pulumi.Int(4),
Tags: pulumi.StringMap{
"hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example": pulumi.String("Resource"),
"hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example": pulumi.String("Resource"),
},
WindowSize: pulumi.String("PT15M"),
})
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.insights.MetricAlert;
import com.pulumi.azurenative.insights.MetricAlertArgs;
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 metricAlert = new MetricAlert("metricAlert", MetricAlertArgs.builder()
.actions()
.criteria(Map.ofEntries(
Map.entry("componentId", "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example"),
Map.entry("failedLocationCount", 2),
Map.entry("odataType", "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria"),
Map.entry("webTestId", "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example")
))
.description("Automatically created alert rule for availability test \"component-example\" a")
.enabled(true)
.evaluationFrequency("PT1M")
.location("global")
.resourceGroupName("rg-example")
.ruleName("webtest-name-example")
.scopes(
"/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example",
"/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example")
.severity(4)
.tags(Map.ofEntries(
Map.entry("hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example", "Resource"),
Map.entry("hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example", "Resource")
))
.windowSize("PT15M")
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
metric_alert = azure_native.insights.MetricAlert("metricAlert",
actions=[],
criteria=azure_native.insights.WebtestLocationAvailabilityCriteriaArgs(
component_id="/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example",
failed_location_count=2,
odata_type="Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria",
web_test_id="/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example",
),
description="Automatically created alert rule for availability test \"component-example\" a",
enabled=True,
evaluation_frequency="PT1M",
location="global",
resource_group_name="rg-example",
rule_name="webtest-name-example",
scopes=[
"/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example",
"/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example",
],
severity=4,
tags={
"hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example": "Resource",
"hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example": "Resource",
},
window_size="PT15M")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const metricAlert = new azure_native.insights.MetricAlert("metricAlert", {
actions: [],
criteria: {
componentId: "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example",
failedLocationCount: 2,
odataType: "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria",
webTestId: "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example",
},
description: "Automatically created alert rule for availability test \"component-example\" a",
enabled: true,
evaluationFrequency: "PT1M",
location: "global",
resourceGroupName: "rg-example",
ruleName: "webtest-name-example",
scopes: [
"/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example",
"/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example",
],
severity: 4,
tags: {
"hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example": "Resource",
"hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example": "Resource",
},
windowSize: "PT15M",
});
resources:
metricAlert:
type: azure-native:insights:MetricAlert
properties:
actions: []
criteria:
componentId: /subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example
failedLocationCount: 2
odataType: Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria
webTestId: /subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example
description: Automatically created alert rule for availability test "component-example" a
enabled: true
evaluationFrequency: PT1M
location: global
resourceGroupName: rg-example
ruleName: webtest-name-example
scopes:
- /subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example
- /subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example
severity: 4
tags:
? hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example
: Resource
? hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example
: Resource
windowSize: PT15M
Create or update an alert rule for Multiple Resource
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var metricAlert = new AzureNative.Insights.MetricAlert("metricAlert", new()
{
Actions = new[]
{
new AzureNative.Insights.Inputs.MetricAlertActionArgs
{
ActionGroupId = "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
WebHookProperties =
{
{ "key11", "value11" },
{ "key12", "value12" },
},
},
},
AutoMitigate = true,
Criteria = new AzureNative.Insights.Inputs.MetricAlertMultipleResourceMultipleMetricCriteriaArgs
{
AllOf = new[]
{
new AzureNative.Insights.Inputs.MetricCriteriaArgs
{
CriterionType = "StaticThresholdCriterion",
Dimensions = new[] {},
MetricName = "Percentage CPU",
MetricNamespace = "microsoft.compute/virtualmachines",
Name = "High_CPU_80",
Operator = "GreaterThan",
Threshold = 80.5,
TimeAggregation = "Average",
},
},
OdataType = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
},
Description = "This is the description of the rule1",
Enabled = true,
EvaluationFrequency = "PT1M",
Location = "global",
ResourceGroupName = "gigtest",
RuleName = "MetricAlertOnMultipleResources",
Scopes = new[]
{
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1",
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2",
},
Severity = 3,
Tags = null,
TargetResourceRegion = "southcentralus",
TargetResourceType = "Microsoft.Compute/virtualMachines",
WindowSize = "PT15M",
});
});
package main
import (
insights "github.com/pulumi/pulumi-azure-native-sdk/insights"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := insights.NewMetricAlert(ctx, "metricAlert", &insights.MetricAlertArgs{
Actions: []insights.MetricAlertActionArgs{
{
ActionGroupId: pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
WebHookProperties: {
"key11": pulumi.String("value11"),
"key12": pulumi.String("value12"),
},
},
},
AutoMitigate: pulumi.Bool(true),
Criteria: insights.MetricAlertMultipleResourceMultipleMetricCriteria{
AllOf: []interface{}{
insights.MetricCriteria{
CriterionType: "StaticThresholdCriterion",
Dimensions: []insights.MetricDimension{},
MetricName: "Percentage CPU",
MetricNamespace: "microsoft.compute/virtualmachines",
Name: "High_CPU_80",
Operator: "GreaterThan",
Threshold: 80.5,
TimeAggregation: "Average",
},
},
OdataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
},
Description: pulumi.String("This is the description of the rule1"),
Enabled: pulumi.Bool(true),
EvaluationFrequency: pulumi.String("PT1M"),
Location: pulumi.String("global"),
ResourceGroupName: pulumi.String("gigtest"),
RuleName: pulumi.String("MetricAlertOnMultipleResources"),
Scopes: pulumi.StringArray{
pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1"),
pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2"),
},
Severity: pulumi.Int(3),
Tags: nil,
TargetResourceRegion: pulumi.String("southcentralus"),
TargetResourceType: pulumi.String("Microsoft.Compute/virtualMachines"),
WindowSize: pulumi.String("PT15M"),
})
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.insights.MetricAlert;
import com.pulumi.azurenative.insights.MetricAlertArgs;
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 metricAlert = new MetricAlert("metricAlert", MetricAlertArgs.builder()
.actions(Map.ofEntries(
Map.entry("actionGroupId", "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
Map.entry("webHookProperties", Map.ofEntries(
Map.entry("key11", "value11"),
Map.entry("key12", "value12")
))
))
.autoMitigate(true)
.criteria(Map.ofEntries(
Map.entry("allOf", Map.ofEntries(
Map.entry("criterionType", "StaticThresholdCriterion"),
Map.entry("dimensions", ),
Map.entry("metricName", "Percentage CPU"),
Map.entry("metricNamespace", "microsoft.compute/virtualmachines"),
Map.entry("name", "High_CPU_80"),
Map.entry("operator", "GreaterThan"),
Map.entry("threshold", 80.5),
Map.entry("timeAggregation", "Average")
)),
Map.entry("odataType", "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria")
))
.description("This is the description of the rule1")
.enabled(true)
.evaluationFrequency("PT1M")
.location("global")
.resourceGroupName("gigtest")
.ruleName("MetricAlertOnMultipleResources")
.scopes(
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1",
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2")
.severity(3)
.tags()
.targetResourceRegion("southcentralus")
.targetResourceType("Microsoft.Compute/virtualMachines")
.windowSize("PT15M")
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
metric_alert = azure_native.insights.MetricAlert("metricAlert",
actions=[azure_native.insights.MetricAlertActionArgs(
action_group_id="/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
web_hook_properties={
"key11": "value11",
"key12": "value12",
},
)],
auto_mitigate=True,
criteria=azure_native.insights.MetricAlertMultipleResourceMultipleMetricCriteriaArgs(
all_of=[azure_native.insights.MetricCriteriaArgs(
criterion_type="StaticThresholdCriterion",
dimensions=[],
metric_name="Percentage CPU",
metric_namespace="microsoft.compute/virtualmachines",
name="High_CPU_80",
operator="GreaterThan",
threshold=80.5,
time_aggregation="Average",
)],
odata_type="Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
),
description="This is the description of the rule1",
enabled=True,
evaluation_frequency="PT1M",
location="global",
resource_group_name="gigtest",
rule_name="MetricAlertOnMultipleResources",
scopes=[
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1",
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2",
],
severity=3,
tags={},
target_resource_region="southcentralus",
target_resource_type="Microsoft.Compute/virtualMachines",
window_size="PT15M")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const metricAlert = new azure_native.insights.MetricAlert("metricAlert", {
actions: [{
actionGroupId: "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
webHookProperties: {
key11: "value11",
key12: "value12",
},
}],
autoMitigate: true,
criteria: {
allOf: [{
criterionType: "StaticThresholdCriterion",
dimensions: [],
metricName: "Percentage CPU",
metricNamespace: "microsoft.compute/virtualmachines",
name: "High_CPU_80",
operator: "GreaterThan",
threshold: 80.5,
timeAggregation: "Average",
}],
odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
},
description: "This is the description of the rule1",
enabled: true,
evaluationFrequency: "PT1M",
location: "global",
resourceGroupName: "gigtest",
ruleName: "MetricAlertOnMultipleResources",
scopes: [
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1",
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2",
],
severity: 3,
tags: {},
targetResourceRegion: "southcentralus",
targetResourceType: "Microsoft.Compute/virtualMachines",
windowSize: "PT15M",
});
resources:
metricAlert:
type: azure-native:insights:MetricAlert
properties:
actions:
- actionGroupId: /subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2
webHookProperties:
key11: value11
key12: value12
autoMitigate: true
criteria:
allOf:
- criterionType: StaticThresholdCriterion
dimensions: []
metricName: Percentage CPU
metricNamespace: microsoft.compute/virtualmachines
name: High_CPU_80
operator: GreaterThan
threshold: 80.5
timeAggregation: Average
odataType: Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria
description: This is the description of the rule1
enabled: true
evaluationFrequency: PT1M
location: global
resourceGroupName: gigtest
ruleName: MetricAlertOnMultipleResources
scopes:
- /subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1
- /subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2
severity: 3
tags: {}
targetResourceRegion: southcentralus
targetResourceType: Microsoft.Compute/virtualMachines
windowSize: PT15M
Create or update an alert rule for Single Resource
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var metricAlert = new AzureNative.Insights.MetricAlert("metricAlert", new()
{
Actions = new[]
{
new AzureNative.Insights.Inputs.MetricAlertActionArgs
{
ActionGroupId = "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
WebHookProperties =
{
{ "key11", "value11" },
{ "key12", "value12" },
},
},
},
AutoMitigate = true,
Criteria = new AzureNative.Insights.Inputs.MetricAlertSingleResourceMultipleMetricCriteriaArgs
{
AllOf = new[]
{
new AzureNative.Insights.Inputs.MetricCriteriaArgs
{
CriterionType = "StaticThresholdCriterion",
Dimensions = new[] {},
MetricName = "\\Processor(_Total)\\% Processor Time",
Name = "High_CPU_80",
Operator = "GreaterThan",
Threshold = 80.5,
TimeAggregation = "Average",
},
},
OdataType = "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria",
},
Description = "This is the description of the rule1",
Enabled = true,
EvaluationFrequency = "Pt1m",
Location = "global",
ResourceGroupName = "gigtest",
RuleName = "chiricutin",
Scopes = new[]
{
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme",
},
Severity = 3,
Tags = null,
WindowSize = "Pt15m",
});
});
package main
import (
insights "github.com/pulumi/pulumi-azure-native-sdk/insights"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := insights.NewMetricAlert(ctx, "metricAlert", &insights.MetricAlertArgs{
Actions: []insights.MetricAlertActionArgs{
{
ActionGroupId: pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
WebHookProperties: {
"key11": pulumi.String("value11"),
"key12": pulumi.String("value12"),
},
},
},
AutoMitigate: pulumi.Bool(true),
Criteria: insights.MetricAlertSingleResourceMultipleMetricCriteria{
AllOf: []insights.MetricCriteria{
{
CriterionType: "StaticThresholdCriterion",
Dimensions: []insights.MetricDimension{},
MetricName: "\\Processor(_Total)\\% Processor Time",
Name: "High_CPU_80",
Operator: "GreaterThan",
Threshold: 80.5,
TimeAggregation: "Average",
},
},
OdataType: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria",
},
Description: pulumi.String("This is the description of the rule1"),
Enabled: pulumi.Bool(true),
EvaluationFrequency: pulumi.String("Pt1m"),
Location: pulumi.String("global"),
ResourceGroupName: pulumi.String("gigtest"),
RuleName: pulumi.String("chiricutin"),
Scopes: pulumi.StringArray{
pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme"),
},
Severity: pulumi.Int(3),
Tags: nil,
WindowSize: pulumi.String("Pt15m"),
})
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.insights.MetricAlert;
import com.pulumi.azurenative.insights.MetricAlertArgs;
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 metricAlert = new MetricAlert("metricAlert", MetricAlertArgs.builder()
.actions(Map.ofEntries(
Map.entry("actionGroupId", "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
Map.entry("webHookProperties", Map.ofEntries(
Map.entry("key11", "value11"),
Map.entry("key12", "value12")
))
))
.autoMitigate(true)
.criteria(Map.ofEntries(
Map.entry("allOf", Map.ofEntries(
Map.entry("criterionType", "StaticThresholdCriterion"),
Map.entry("dimensions", ),
Map.entry("metricName", "\\Processor(_Total)\\% Processor Time"),
Map.entry("name", "High_CPU_80"),
Map.entry("operator", "GreaterThan"),
Map.entry("threshold", 80.5),
Map.entry("timeAggregation", "Average")
)),
Map.entry("odataType", "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria")
))
.description("This is the description of the rule1")
.enabled(true)
.evaluationFrequency("Pt1m")
.location("global")
.resourceGroupName("gigtest")
.ruleName("chiricutin")
.scopes("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme")
.severity(3)
.tags()
.windowSize("Pt15m")
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
metric_alert = azure_native.insights.MetricAlert("metricAlert",
actions=[azure_native.insights.MetricAlertActionArgs(
action_group_id="/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
web_hook_properties={
"key11": "value11",
"key12": "value12",
},
)],
auto_mitigate=True,
criteria=azure_native.insights.MetricAlertSingleResourceMultipleMetricCriteriaArgs(
all_of=[azure_native.insights.MetricCriteriaArgs(
criterion_type="StaticThresholdCriterion",
dimensions=[],
metric_name="\\Processor(_Total)\\% Processor Time",
name="High_CPU_80",
operator="GreaterThan",
threshold=80.5,
time_aggregation="Average",
)],
odata_type="Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria",
),
description="This is the description of the rule1",
enabled=True,
evaluation_frequency="Pt1m",
location="global",
resource_group_name="gigtest",
rule_name="chiricutin",
scopes=["/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme"],
severity=3,
tags={},
window_size="Pt15m")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const metricAlert = new azure_native.insights.MetricAlert("metricAlert", {
actions: [{
actionGroupId: "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
webHookProperties: {
key11: "value11",
key12: "value12",
},
}],
autoMitigate: true,
criteria: {
allOf: [{
criterionType: "StaticThresholdCriterion",
dimensions: [],
metricName: "\\Processor(_Total)\\% Processor Time",
name: "High_CPU_80",
operator: "GreaterThan",
threshold: 80.5,
timeAggregation: "Average",
}],
odataType: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria",
},
description: "This is the description of the rule1",
enabled: true,
evaluationFrequency: "Pt1m",
location: "global",
resourceGroupName: "gigtest",
ruleName: "chiricutin",
scopes: ["/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme"],
severity: 3,
tags: {},
windowSize: "Pt15m",
});
resources:
metricAlert:
type: azure-native:insights:MetricAlert
properties:
actions:
- actionGroupId: /subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2
webHookProperties:
key11: value11
key12: value12
autoMitigate: true
criteria:
allOf:
- criterionType: StaticThresholdCriterion
dimensions: []
metricName: \Processor(_Total)\% Processor Time
name: High_CPU_80
operator: GreaterThan
threshold: 80.5
timeAggregation: Average
odataType: Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria
description: This is the description of the rule1
enabled: true
evaluationFrequency: Pt1m
location: global
resourceGroupName: gigtest
ruleName: chiricutin
scopes:
- /subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme
severity: 3
tags: {}
windowSize: Pt15m
Create or update an alert rule on Resource group(s)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var metricAlert = new AzureNative.Insights.MetricAlert("metricAlert", new()
{
Actions = new[]
{
new AzureNative.Insights.Inputs.MetricAlertActionArgs
{
ActionGroupId = "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
WebHookProperties =
{
{ "key11", "value11" },
{ "key12", "value12" },
},
},
},
AutoMitigate = true,
Criteria = new AzureNative.Insights.Inputs.MetricAlertMultipleResourceMultipleMetricCriteriaArgs
{
AllOf = new[]
{
new AzureNative.Insights.Inputs.MetricCriteriaArgs
{
CriterionType = "StaticThresholdCriterion",
Dimensions = new[] {},
MetricName = "Percentage CPU",
MetricNamespace = "microsoft.compute/virtualmachines",
Name = "High_CPU_80",
Operator = "GreaterThan",
Threshold = 80.5,
TimeAggregation = "Average",
},
},
OdataType = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
},
Description = "This is the description of the rule1",
Enabled = true,
EvaluationFrequency = "PT1M",
Location = "global",
ResourceGroupName = "gigtest1",
RuleName = "MetricAlertAtResourceGroupLevel",
Scopes = new[]
{
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1",
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest2",
},
Severity = 3,
Tags = null,
TargetResourceRegion = "southcentralus",
TargetResourceType = "Microsoft.Compute/virtualMachines",
WindowSize = "PT15M",
});
});
package main
import (
insights "github.com/pulumi/pulumi-azure-native-sdk/insights"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := insights.NewMetricAlert(ctx, "metricAlert", &insights.MetricAlertArgs{
Actions: []insights.MetricAlertActionArgs{
{
ActionGroupId: pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
WebHookProperties: {
"key11": pulumi.String("value11"),
"key12": pulumi.String("value12"),
},
},
},
AutoMitigate: pulumi.Bool(true),
Criteria: insights.MetricAlertMultipleResourceMultipleMetricCriteria{
AllOf: []interface{}{
insights.MetricCriteria{
CriterionType: "StaticThresholdCriterion",
Dimensions: []insights.MetricDimension{},
MetricName: "Percentage CPU",
MetricNamespace: "microsoft.compute/virtualmachines",
Name: "High_CPU_80",
Operator: "GreaterThan",
Threshold: 80.5,
TimeAggregation: "Average",
},
},
OdataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
},
Description: pulumi.String("This is the description of the rule1"),
Enabled: pulumi.Bool(true),
EvaluationFrequency: pulumi.String("PT1M"),
Location: pulumi.String("global"),
ResourceGroupName: pulumi.String("gigtest1"),
RuleName: pulumi.String("MetricAlertAtResourceGroupLevel"),
Scopes: pulumi.StringArray{
pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1"),
pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest2"),
},
Severity: pulumi.Int(3),
Tags: nil,
TargetResourceRegion: pulumi.String("southcentralus"),
TargetResourceType: pulumi.String("Microsoft.Compute/virtualMachines"),
WindowSize: pulumi.String("PT15M"),
})
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.insights.MetricAlert;
import com.pulumi.azurenative.insights.MetricAlertArgs;
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 metricAlert = new MetricAlert("metricAlert", MetricAlertArgs.builder()
.actions(Map.ofEntries(
Map.entry("actionGroupId", "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
Map.entry("webHookProperties", Map.ofEntries(
Map.entry("key11", "value11"),
Map.entry("key12", "value12")
))
))
.autoMitigate(true)
.criteria(Map.ofEntries(
Map.entry("allOf", Map.ofEntries(
Map.entry("criterionType", "StaticThresholdCriterion"),
Map.entry("dimensions", ),
Map.entry("metricName", "Percentage CPU"),
Map.entry("metricNamespace", "microsoft.compute/virtualmachines"),
Map.entry("name", "High_CPU_80"),
Map.entry("operator", "GreaterThan"),
Map.entry("threshold", 80.5),
Map.entry("timeAggregation", "Average")
)),
Map.entry("odataType", "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria")
))
.description("This is the description of the rule1")
.enabled(true)
.evaluationFrequency("PT1M")
.location("global")
.resourceGroupName("gigtest1")
.ruleName("MetricAlertAtResourceGroupLevel")
.scopes(
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1",
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest2")
.severity(3)
.tags()
.targetResourceRegion("southcentralus")
.targetResourceType("Microsoft.Compute/virtualMachines")
.windowSize("PT15M")
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
metric_alert = azure_native.insights.MetricAlert("metricAlert",
actions=[azure_native.insights.MetricAlertActionArgs(
action_group_id="/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
web_hook_properties={
"key11": "value11",
"key12": "value12",
},
)],
auto_mitigate=True,
criteria=azure_native.insights.MetricAlertMultipleResourceMultipleMetricCriteriaArgs(
all_of=[azure_native.insights.MetricCriteriaArgs(
criterion_type="StaticThresholdCriterion",
dimensions=[],
metric_name="Percentage CPU",
metric_namespace="microsoft.compute/virtualmachines",
name="High_CPU_80",
operator="GreaterThan",
threshold=80.5,
time_aggregation="Average",
)],
odata_type="Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
),
description="This is the description of the rule1",
enabled=True,
evaluation_frequency="PT1M",
location="global",
resource_group_name="gigtest1",
rule_name="MetricAlertAtResourceGroupLevel",
scopes=[
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1",
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest2",
],
severity=3,
tags={},
target_resource_region="southcentralus",
target_resource_type="Microsoft.Compute/virtualMachines",
window_size="PT15M")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const metricAlert = new azure_native.insights.MetricAlert("metricAlert", {
actions: [{
actionGroupId: "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
webHookProperties: {
key11: "value11",
key12: "value12",
},
}],
autoMitigate: true,
criteria: {
allOf: [{
criterionType: "StaticThresholdCriterion",
dimensions: [],
metricName: "Percentage CPU",
metricNamespace: "microsoft.compute/virtualmachines",
name: "High_CPU_80",
operator: "GreaterThan",
threshold: 80.5,
timeAggregation: "Average",
}],
odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
},
description: "This is the description of the rule1",
enabled: true,
evaluationFrequency: "PT1M",
location: "global",
resourceGroupName: "gigtest1",
ruleName: "MetricAlertAtResourceGroupLevel",
scopes: [
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1",
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest2",
],
severity: 3,
tags: {},
targetResourceRegion: "southcentralus",
targetResourceType: "Microsoft.Compute/virtualMachines",
windowSize: "PT15M",
});
resources:
metricAlert:
type: azure-native:insights:MetricAlert
properties:
actions:
- actionGroupId: /subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2
webHookProperties:
key11: value11
key12: value12
autoMitigate: true
criteria:
allOf:
- criterionType: StaticThresholdCriterion
dimensions: []
metricName: Percentage CPU
metricNamespace: microsoft.compute/virtualmachines
name: High_CPU_80
operator: GreaterThan
threshold: 80.5
timeAggregation: Average
odataType: Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria
description: This is the description of the rule1
enabled: true
evaluationFrequency: PT1M
location: global
resourceGroupName: gigtest1
ruleName: MetricAlertAtResourceGroupLevel
scopes:
- /subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1
- /subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest2
severity: 3
tags: {}
targetResourceRegion: southcentralus
targetResourceType: Microsoft.Compute/virtualMachines
windowSize: PT15M
Create or update an alert rule on Subscription
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var metricAlert = new AzureNative.Insights.MetricAlert("metricAlert", new()
{
Actions = new[]
{
new AzureNative.Insights.Inputs.MetricAlertActionArgs
{
ActionGroupId = "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
WebHookProperties =
{
{ "key11", "value11" },
{ "key12", "value12" },
},
},
},
AutoMitigate = true,
Criteria = new AzureNative.Insights.Inputs.MetricAlertMultipleResourceMultipleMetricCriteriaArgs
{
AllOf = new[]
{
new AzureNative.Insights.Inputs.MetricCriteriaArgs
{
CriterionType = "StaticThresholdCriterion",
Dimensions = new[] {},
MetricName = "Percentage CPU",
MetricNamespace = "microsoft.compute/virtualmachines",
Name = "High_CPU_80",
Operator = "GreaterThan",
Threshold = 80.5,
TimeAggregation = "Average",
},
},
OdataType = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
},
Description = "This is the description of the rule1",
Enabled = true,
EvaluationFrequency = "PT1M",
Location = "global",
ResourceGroupName = "gigtest",
RuleName = "MetricAlertAtSubscriptionLevel",
Scopes = new[]
{
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7",
},
Severity = 3,
Tags = null,
TargetResourceRegion = "southcentralus",
TargetResourceType = "Microsoft.Compute/virtualMachines",
WindowSize = "PT15M",
});
});
package main
import (
insights "github.com/pulumi/pulumi-azure-native-sdk/insights"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := insights.NewMetricAlert(ctx, "metricAlert", &insights.MetricAlertArgs{
Actions: []insights.MetricAlertActionArgs{
{
ActionGroupId: pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
WebHookProperties: {
"key11": pulumi.String("value11"),
"key12": pulumi.String("value12"),
},
},
},
AutoMitigate: pulumi.Bool(true),
Criteria: insights.MetricAlertMultipleResourceMultipleMetricCriteria{
AllOf: []interface{}{
insights.MetricCriteria{
CriterionType: "StaticThresholdCriterion",
Dimensions: []insights.MetricDimension{},
MetricName: "Percentage CPU",
MetricNamespace: "microsoft.compute/virtualmachines",
Name: "High_CPU_80",
Operator: "GreaterThan",
Threshold: 80.5,
TimeAggregation: "Average",
},
},
OdataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
},
Description: pulumi.String("This is the description of the rule1"),
Enabled: pulumi.Bool(true),
EvaluationFrequency: pulumi.String("PT1M"),
Location: pulumi.String("global"),
ResourceGroupName: pulumi.String("gigtest"),
RuleName: pulumi.String("MetricAlertAtSubscriptionLevel"),
Scopes: pulumi.StringArray{
pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"),
},
Severity: pulumi.Int(3),
Tags: nil,
TargetResourceRegion: pulumi.String("southcentralus"),
TargetResourceType: pulumi.String("Microsoft.Compute/virtualMachines"),
WindowSize: pulumi.String("PT15M"),
})
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.insights.MetricAlert;
import com.pulumi.azurenative.insights.MetricAlertArgs;
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 metricAlert = new MetricAlert("metricAlert", MetricAlertArgs.builder()
.actions(Map.ofEntries(
Map.entry("actionGroupId", "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
Map.entry("webHookProperties", Map.ofEntries(
Map.entry("key11", "value11"),
Map.entry("key12", "value12")
))
))
.autoMitigate(true)
.criteria(Map.ofEntries(
Map.entry("allOf", Map.ofEntries(
Map.entry("criterionType", "StaticThresholdCriterion"),
Map.entry("dimensions", ),
Map.entry("metricName", "Percentage CPU"),
Map.entry("metricNamespace", "microsoft.compute/virtualmachines"),
Map.entry("name", "High_CPU_80"),
Map.entry("operator", "GreaterThan"),
Map.entry("threshold", 80.5),
Map.entry("timeAggregation", "Average")
)),
Map.entry("odataType", "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria")
))
.description("This is the description of the rule1")
.enabled(true)
.evaluationFrequency("PT1M")
.location("global")
.resourceGroupName("gigtest")
.ruleName("MetricAlertAtSubscriptionLevel")
.scopes("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7")
.severity(3)
.tags()
.targetResourceRegion("southcentralus")
.targetResourceType("Microsoft.Compute/virtualMachines")
.windowSize("PT15M")
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
metric_alert = azure_native.insights.MetricAlert("metricAlert",
actions=[azure_native.insights.MetricAlertActionArgs(
action_group_id="/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
web_hook_properties={
"key11": "value11",
"key12": "value12",
},
)],
auto_mitigate=True,
criteria=azure_native.insights.MetricAlertMultipleResourceMultipleMetricCriteriaArgs(
all_of=[azure_native.insights.MetricCriteriaArgs(
criterion_type="StaticThresholdCriterion",
dimensions=[],
metric_name="Percentage CPU",
metric_namespace="microsoft.compute/virtualmachines",
name="High_CPU_80",
operator="GreaterThan",
threshold=80.5,
time_aggregation="Average",
)],
odata_type="Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
),
description="This is the description of the rule1",
enabled=True,
evaluation_frequency="PT1M",
location="global",
resource_group_name="gigtest",
rule_name="MetricAlertAtSubscriptionLevel",
scopes=["/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"],
severity=3,
tags={},
target_resource_region="southcentralus",
target_resource_type="Microsoft.Compute/virtualMachines",
window_size="PT15M")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const metricAlert = new azure_native.insights.MetricAlert("metricAlert", {
actions: [{
actionGroupId: "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
webHookProperties: {
key11: "value11",
key12: "value12",
},
}],
autoMitigate: true,
criteria: {
allOf: [{
criterionType: "StaticThresholdCriterion",
dimensions: [],
metricName: "Percentage CPU",
metricNamespace: "microsoft.compute/virtualmachines",
name: "High_CPU_80",
operator: "GreaterThan",
threshold: 80.5,
timeAggregation: "Average",
}],
odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
},
description: "This is the description of the rule1",
enabled: true,
evaluationFrequency: "PT1M",
location: "global",
resourceGroupName: "gigtest",
ruleName: "MetricAlertAtSubscriptionLevel",
scopes: ["/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"],
severity: 3,
tags: {},
targetResourceRegion: "southcentralus",
targetResourceType: "Microsoft.Compute/virtualMachines",
windowSize: "PT15M",
});
resources:
metricAlert:
type: azure-native:insights:MetricAlert
properties:
actions:
- actionGroupId: /subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2
webHookProperties:
key11: value11
key12: value12
autoMitigate: true
criteria:
allOf:
- criterionType: StaticThresholdCriterion
dimensions: []
metricName: Percentage CPU
metricNamespace: microsoft.compute/virtualmachines
name: High_CPU_80
operator: GreaterThan
threshold: 80.5
timeAggregation: Average
odataType: Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria
description: This is the description of the rule1
enabled: true
evaluationFrequency: PT1M
location: global
resourceGroupName: gigtest
ruleName: MetricAlertAtSubscriptionLevel
scopes:
- /subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7
severity: 3
tags: {}
targetResourceRegion: southcentralus
targetResourceType: Microsoft.Compute/virtualMachines
windowSize: PT15M
Create or update an alert rules with dimensions
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var metricAlert = new AzureNative.Insights.MetricAlert("metricAlert", new()
{
Actions = new[]
{
new AzureNative.Insights.Inputs.MetricAlertActionArgs
{
ActionGroupId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
WebHookProperties =
{
{ "key11", "value11" },
{ "key12", "value12" },
},
},
},
AutoMitigate = true,
Criteria = new AzureNative.Insights.Inputs.MetricAlertMultipleResourceMultipleMetricCriteriaArgs
{
AllOf = new[]
{
new AzureNative.Insights.Inputs.MetricCriteriaArgs
{
CriterionType = "StaticThresholdCriterion",
Dimensions = new[]
{
new AzureNative.Insights.Inputs.MetricDimensionArgs
{
Name = "ActivityName",
Operator = "Include",
Values = new[]
{
"*",
},
},
new AzureNative.Insights.Inputs.MetricDimensionArgs
{
Name = "StatusCode",
Operator = "Include",
Values = new[]
{
"200",
},
},
},
MetricName = "Availability",
MetricNamespace = "Microsoft.KeyVault/vaults",
Name = "Metric1",
Operator = "GreaterThan",
Threshold = 55,
TimeAggregation = "Average",
},
},
OdataType = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
},
Description = "This is the description of the rule1",
Enabled = true,
EvaluationFrequency = "PT1H",
Location = "global",
ResourceGroupName = "gigtest",
RuleName = "MetricAlertOnMultipleDimensions",
Scopes = new[]
{
"/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.KeyVault/vaults/keyVaultResource",
},
Severity = 3,
Tags = null,
WindowSize = "P1D",
});
});
package main
import (
insights "github.com/pulumi/pulumi-azure-native-sdk/insights"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := insights.NewMetricAlert(ctx, "metricAlert", &insights.MetricAlertArgs{
Actions: []insights.MetricAlertActionArgs{
{
ActionGroupId: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
WebHookProperties: {
"key11": pulumi.String("value11"),
"key12": pulumi.String("value12"),
},
},
},
AutoMitigate: pulumi.Bool(true),
Criteria: insights.MetricAlertMultipleResourceMultipleMetricCriteria{
AllOf: []interface{}{
insights.MetricCriteria{
CriterionType: "StaticThresholdCriterion",
Dimensions: []insights.MetricDimension{
{
Name: "ActivityName",
Operator: "Include",
Values: []string{
"*",
},
},
{
Name: "StatusCode",
Operator: "Include",
Values: []string{
"200",
},
},
},
MetricName: "Availability",
MetricNamespace: "Microsoft.KeyVault/vaults",
Name: "Metric1",
Operator: "GreaterThan",
Threshold: 55,
TimeAggregation: "Average",
},
},
OdataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
},
Description: pulumi.String("This is the description of the rule1"),
Enabled: pulumi.Bool(true),
EvaluationFrequency: pulumi.String("PT1H"),
Location: pulumi.String("global"),
ResourceGroupName: pulumi.String("gigtest"),
RuleName: pulumi.String("MetricAlertOnMultipleDimensions"),
Scopes: pulumi.StringArray{
pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.KeyVault/vaults/keyVaultResource"),
},
Severity: pulumi.Int(3),
Tags: nil,
WindowSize: pulumi.String("P1D"),
})
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.insights.MetricAlert;
import com.pulumi.azurenative.insights.MetricAlertArgs;
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 metricAlert = new MetricAlert("metricAlert", MetricAlertArgs.builder()
.actions(Map.ofEntries(
Map.entry("actionGroupId", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
Map.entry("webHookProperties", Map.ofEntries(
Map.entry("key11", "value11"),
Map.entry("key12", "value12")
))
))
.autoMitigate(true)
.criteria(Map.ofEntries(
Map.entry("allOf", Map.ofEntries(
Map.entry("criterionType", "StaticThresholdCriterion"),
Map.entry("dimensions",
Map.ofEntries(
Map.entry("name", "ActivityName"),
Map.entry("operator", "Include"),
Map.entry("values", "*")
),
Map.ofEntries(
Map.entry("name", "StatusCode"),
Map.entry("operator", "Include"),
Map.entry("values", "200")
)),
Map.entry("metricName", "Availability"),
Map.entry("metricNamespace", "Microsoft.KeyVault/vaults"),
Map.entry("name", "Metric1"),
Map.entry("operator", "GreaterThan"),
Map.entry("threshold", 55),
Map.entry("timeAggregation", "Average")
)),
Map.entry("odataType", "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria")
))
.description("This is the description of the rule1")
.enabled(true)
.evaluationFrequency("PT1H")
.location("global")
.resourceGroupName("gigtest")
.ruleName("MetricAlertOnMultipleDimensions")
.scopes("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.KeyVault/vaults/keyVaultResource")
.severity(3)
.tags()
.windowSize("P1D")
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
metric_alert = azure_native.insights.MetricAlert("metricAlert",
actions=[azure_native.insights.MetricAlertActionArgs(
action_group_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
web_hook_properties={
"key11": "value11",
"key12": "value12",
},
)],
auto_mitigate=True,
criteria=azure_native.insights.MetricAlertMultipleResourceMultipleMetricCriteriaArgs(
all_of=[azure_native.insights.MetricCriteriaArgs(
criterion_type="StaticThresholdCriterion",
dimensions=[
azure_native.insights.MetricDimensionArgs(
name="ActivityName",
operator="Include",
values=["*"],
),
azure_native.insights.MetricDimensionArgs(
name="StatusCode",
operator="Include",
values=["200"],
),
],
metric_name="Availability",
metric_namespace="Microsoft.KeyVault/vaults",
name="Metric1",
operator="GreaterThan",
threshold=55,
time_aggregation="Average",
)],
odata_type="Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
),
description="This is the description of the rule1",
enabled=True,
evaluation_frequency="PT1H",
location="global",
resource_group_name="gigtest",
rule_name="MetricAlertOnMultipleDimensions",
scopes=["/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.KeyVault/vaults/keyVaultResource"],
severity=3,
tags={},
window_size="P1D")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const metricAlert = new azure_native.insights.MetricAlert("metricAlert", {
actions: [{
actionGroupId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
webHookProperties: {
key11: "value11",
key12: "value12",
},
}],
autoMitigate: true,
criteria: {
allOf: [{
criterionType: "StaticThresholdCriterion",
dimensions: [
{
name: "ActivityName",
operator: "Include",
values: ["*"],
},
{
name: "StatusCode",
operator: "Include",
values: ["200"],
},
],
metricName: "Availability",
metricNamespace: "Microsoft.KeyVault/vaults",
name: "Metric1",
operator: "GreaterThan",
threshold: 55,
timeAggregation: "Average",
}],
odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
},
description: "This is the description of the rule1",
enabled: true,
evaluationFrequency: "PT1H",
location: "global",
resourceGroupName: "gigtest",
ruleName: "MetricAlertOnMultipleDimensions",
scopes: ["/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.KeyVault/vaults/keyVaultResource"],
severity: 3,
tags: {},
windowSize: "P1D",
});
resources:
metricAlert:
type: azure-native:insights:MetricAlert
properties:
actions:
- actionGroupId: /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2
webHookProperties:
key11: value11
key12: value12
autoMitigate: true
criteria:
allOf:
- criterionType: StaticThresholdCriterion
dimensions:
- name: ActivityName
operator: Include
values:
- '*'
- name: StatusCode
operator: Include
values:
- '200'
metricName: Availability
metricNamespace: Microsoft.KeyVault/vaults
name: Metric1
operator: GreaterThan
threshold: 55
timeAggregation: Average
odataType: Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria
description: This is the description of the rule1
enabled: true
evaluationFrequency: PT1H
location: global
resourceGroupName: gigtest
ruleName: MetricAlertOnMultipleDimensions
scopes:
- /subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.KeyVault/vaults/keyVaultResource
severity: 3
tags: {}
windowSize: P1D
Create MetricAlert Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MetricAlert(name: string, args: MetricAlertArgs, opts?: CustomResourceOptions);
@overload
def MetricAlert(resource_name: str,
args: MetricAlertArgs,
opts: Optional[ResourceOptions] = None)
@overload
def MetricAlert(resource_name: str,
opts: Optional[ResourceOptions] = None,
resource_group_name: Optional[str] = None,
window_size: Optional[str] = None,
criteria: Optional[Union[MetricAlertMultipleResourceMultipleMetricCriteriaArgs, MetricAlertSingleResourceMultipleMetricCriteriaArgs, WebtestLocationAvailabilityCriteriaArgs]] = None,
severity: Optional[int] = None,
enabled: Optional[bool] = None,
evaluation_frequency: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
description: Optional[str] = None,
rule_name: Optional[str] = None,
location: Optional[str] = None,
actions: Optional[Sequence[MetricAlertActionArgs]] = None,
tags: Optional[Mapping[str, str]] = None,
target_resource_region: Optional[str] = None,
target_resource_type: Optional[str] = None,
auto_mitigate: Optional[bool] = None)
func NewMetricAlert(ctx *Context, name string, args MetricAlertArgs, opts ...ResourceOption) (*MetricAlert, error)
public MetricAlert(string name, MetricAlertArgs args, CustomResourceOptions? opts = null)
public MetricAlert(String name, MetricAlertArgs args)
public MetricAlert(String name, MetricAlertArgs args, CustomResourceOptions options)
type: azure-native:insights:MetricAlert
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 MetricAlertArgs
- 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 MetricAlertArgs
- 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 MetricAlertArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MetricAlertArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MetricAlertArgs
- 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 metricAlertResource = new AzureNative.Insights.MetricAlert("metricAlertResource", new()
{
ResourceGroupName = "string",
WindowSize = "string",
Criteria =
{
{ "odataType", "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" },
{ "allOf", new[]
{
{
{ "alertSensitivity", "string" },
{ "criterionType", "DynamicThresholdCriterion" },
{ "failingPeriods",
{
{ "minFailingPeriodsToAlert", 0 },
{ "numberOfEvaluationPeriods", 0 },
} },
{ "metricName", "string" },
{ "name", "string" },
{ "operator", "string" },
{ "timeAggregation", "string" },
{ "dimensions", new[]
{
{
{ "name", "string" },
{ "operator", "string" },
{ "values", new[]
{
"string",
} },
},
} },
{ "ignoreDataBefore", "string" },
{ "metricNamespace", "string" },
{ "skipMetricValidation", false },
},
} },
},
Severity = 0,
Enabled = false,
EvaluationFrequency = "string",
Scopes = new[]
{
"string",
},
Description = "string",
RuleName = "string",
Location = "string",
Actions = new[]
{
{
{ "actionGroupId", "string" },
{ "webHookProperties",
{
{ "string", "string" },
} },
},
},
Tags =
{
{ "string", "string" },
},
TargetResourceRegion = "string",
TargetResourceType = "string",
AutoMitigate = false,
});
example, err := insights.NewMetricAlert(ctx, "metricAlertResource", &insights.MetricAlertArgs{
ResourceGroupName: "string",
WindowSize: "string",
Criteria: map[string]interface{}{
"odataType": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
"allOf": []map[string]interface{}{
map[string]interface{}{
"alertSensitivity": "string",
"criterionType": "DynamicThresholdCriterion",
"failingPeriods": map[string]interface{}{
"minFailingPeriodsToAlert": 0,
"numberOfEvaluationPeriods": 0,
},
"metricName": "string",
"name": "string",
"operator": "string",
"timeAggregation": "string",
"dimensions": []map[string]interface{}{
map[string]interface{}{
"name": "string",
"operator": "string",
"values": []string{
"string",
},
},
},
"ignoreDataBefore": "string",
"metricNamespace": "string",
"skipMetricValidation": false,
},
},
},
Severity: 0,
Enabled: false,
EvaluationFrequency: "string",
Scopes: []string{
"string",
},
Description: "string",
RuleName: "string",
Location: "string",
Actions: []map[string]interface{}{
map[string]interface{}{
"actionGroupId": "string",
"webHookProperties": map[string]interface{}{
"string": "string",
},
},
},
Tags: map[string]interface{}{
"string": "string",
},
TargetResourceRegion: "string",
TargetResourceType: "string",
AutoMitigate: false,
})
var metricAlertResource = new MetricAlert("metricAlertResource", MetricAlertArgs.builder()
.resourceGroupName("string")
.windowSize("string")
.criteria(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.severity(0)
.enabled(false)
.evaluationFrequency("string")
.scopes("string")
.description("string")
.ruleName("string")
.location("string")
.actions(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.tags(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.targetResourceRegion("string")
.targetResourceType("string")
.autoMitigate(false)
.build());
metric_alert_resource = azure_native.insights.MetricAlert("metricAlertResource",
resource_group_name=string,
window_size=string,
criteria={
odataType: Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria,
allOf: [{
alertSensitivity: string,
criterionType: DynamicThresholdCriterion,
failingPeriods: {
minFailingPeriodsToAlert: 0,
numberOfEvaluationPeriods: 0,
},
metricName: string,
name: string,
operator: string,
timeAggregation: string,
dimensions: [{
name: string,
operator: string,
values: [string],
}],
ignoreDataBefore: string,
metricNamespace: string,
skipMetricValidation: False,
}],
},
severity=0,
enabled=False,
evaluation_frequency=string,
scopes=[string],
description=string,
rule_name=string,
location=string,
actions=[{
actionGroupId: string,
webHookProperties: {
string: string,
},
}],
tags={
string: string,
},
target_resource_region=string,
target_resource_type=string,
auto_mitigate=False)
const metricAlertResource = new azure_native.insights.MetricAlert("metricAlertResource", {
resourceGroupName: "string",
windowSize: "string",
criteria: {
odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
allOf: [{
alertSensitivity: "string",
criterionType: "DynamicThresholdCriterion",
failingPeriods: {
minFailingPeriodsToAlert: 0,
numberOfEvaluationPeriods: 0,
},
metricName: "string",
name: "string",
operator: "string",
timeAggregation: "string",
dimensions: [{
name: "string",
operator: "string",
values: ["string"],
}],
ignoreDataBefore: "string",
metricNamespace: "string",
skipMetricValidation: false,
}],
},
severity: 0,
enabled: false,
evaluationFrequency: "string",
scopes: ["string"],
description: "string",
ruleName: "string",
location: "string",
actions: [{
actionGroupId: "string",
webHookProperties: {
string: "string",
},
}],
tags: {
string: "string",
},
targetResourceRegion: "string",
targetResourceType: "string",
autoMitigate: false,
});
type: azure-native:insights:MetricAlert
properties:
actions:
- actionGroupId: string
webHookProperties:
string: string
autoMitigate: false
criteria:
allOf:
- alertSensitivity: string
criterionType: DynamicThresholdCriterion
dimensions:
- name: string
operator: string
values:
- string
failingPeriods:
minFailingPeriodsToAlert: 0
numberOfEvaluationPeriods: 0
ignoreDataBefore: string
metricName: string
metricNamespace: string
name: string
operator: string
skipMetricValidation: false
timeAggregation: string
odataType: Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria
description: string
enabled: false
evaluationFrequency: string
location: string
resourceGroupName: string
ruleName: string
scopes:
- string
severity: 0
tags:
string: string
targetResourceRegion: string
targetResourceType: string
windowSize: string
MetricAlert Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The MetricAlert resource accepts the following input properties:
- Criteria
Pulumi.
Azure | Pulumi.Native. Insights. Inputs. Metric Alert Multiple Resource Multiple Metric Criteria Azure | Pulumi.Native. Insights. Inputs. Metric Alert Single Resource Multiple Metric Criteria Azure Native. Insights. Inputs. Webtest Location Availability Criteria - defines the specific alert criteria information.
- Enabled bool
- the flag that indicates whether the metric alert is enabled.
- Evaluation
Frequency string - how often the metric alert is evaluated represented in ISO 8601 duration format.
- Resource
Group stringName - The name of the resource group. The name is case insensitive.
- Scopes List<string>
- the list of resource id's that this metric alert is scoped to.
- Severity int
- Alert severity {0, 1, 2, 3, 4}
- Window
Size string - the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold.
- Actions
List<Pulumi.
Azure Native. Insights. Inputs. Metric Alert Action> - the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
- Auto
Mitigate bool - the flag that indicates whether the alert should be auto resolved or not. The default is true.
- Description string
- the description of the metric alert that will be included in the alert email.
- Location string
- Resource location
- Rule
Name string - The name of the rule.
- Dictionary<string, string>
- Resource tags
- Target
Resource stringRegion - the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
- Target
Resource stringType - the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
- Criteria
Metric
Alert | MetricMultiple Resource Multiple Metric Criteria Args Alert | WebtestSingle Resource Multiple Metric Criteria Args Location Availability Criteria Args - defines the specific alert criteria information.
- Enabled bool
- the flag that indicates whether the metric alert is enabled.
- Evaluation
Frequency string - how often the metric alert is evaluated represented in ISO 8601 duration format.
- Resource
Group stringName - The name of the resource group. The name is case insensitive.
- Scopes []string
- the list of resource id's that this metric alert is scoped to.
- Severity int
- Alert severity {0, 1, 2, 3, 4}
- Window
Size string - the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold.
- Actions
[]Metric
Alert Action Args - the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
- Auto
Mitigate bool - the flag that indicates whether the alert should be auto resolved or not. The default is true.
- Description string
- the description of the metric alert that will be included in the alert email.
- Location string
- Resource location
- Rule
Name string - The name of the rule.
- map[string]string
- Resource tags
- Target
Resource stringRegion - the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
- Target
Resource stringType - the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
- criteria
Metric
Alert | MetricMultiple Resource Multiple Metric Criteria Alert | WebtestSingle Resource Multiple Metric Criteria Location Availability Criteria - defines the specific alert criteria information.
- enabled Boolean
- the flag that indicates whether the metric alert is enabled.
- evaluation
Frequency String - how often the metric alert is evaluated represented in ISO 8601 duration format.
- resource
Group StringName - The name of the resource group. The name is case insensitive.
- scopes List<String>
- the list of resource id's that this metric alert is scoped to.
- severity Integer
- Alert severity {0, 1, 2, 3, 4}
- window
Size String - the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold.
- actions
List<Metric
Alert Action> - the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
- auto
Mitigate Boolean - the flag that indicates whether the alert should be auto resolved or not. The default is true.
- description String
- the description of the metric alert that will be included in the alert email.
- location String
- Resource location
- rule
Name String - The name of the rule.
- Map<String,String>
- Resource tags
- target
Resource StringRegion - the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
- target
Resource StringType - the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
- criteria
Metric
Alert | MetricMultiple Resource Multiple Metric Criteria Alert | WebtestSingle Resource Multiple Metric Criteria Location Availability Criteria - defines the specific alert criteria information.
- enabled boolean
- the flag that indicates whether the metric alert is enabled.
- evaluation
Frequency string - how often the metric alert is evaluated represented in ISO 8601 duration format.
- resource
Group stringName - The name of the resource group. The name is case insensitive.
- scopes string[]
- the list of resource id's that this metric alert is scoped to.
- severity number
- Alert severity {0, 1, 2, 3, 4}
- window
Size string - the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold.
- actions
Metric
Alert Action[] - the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
- auto
Mitigate boolean - the flag that indicates whether the alert should be auto resolved or not. The default is true.
- description string
- the description of the metric alert that will be included in the alert email.
- location string
- Resource location
- rule
Name string - The name of the rule.
- {[key: string]: string}
- Resource tags
- target
Resource stringRegion - the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
- target
Resource stringType - the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
- criteria
Metric
Alert | MetricMultiple Resource Multiple Metric Criteria Args Alert | WebtestSingle Resource Multiple Metric Criteria Args Location Availability Criteria Args - defines the specific alert criteria information.
- enabled bool
- the flag that indicates whether the metric alert is enabled.
- evaluation_
frequency str - how often the metric alert is evaluated represented in ISO 8601 duration format.
- resource_
group_ strname - The name of the resource group. The name is case insensitive.
- scopes Sequence[str]
- the list of resource id's that this metric alert is scoped to.
- severity int
- Alert severity {0, 1, 2, 3, 4}
- window_
size str - the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold.
- actions
Sequence[Metric
Alert Action Args] - the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
- auto_
mitigate bool - the flag that indicates whether the alert should be auto resolved or not. The default is true.
- description str
- the description of the metric alert that will be included in the alert email.
- location str
- Resource location
- rule_
name str - The name of the rule.
- Mapping[str, str]
- Resource tags
- target_
resource_ strregion - the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
- target_
resource_ strtype - the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
- criteria Property Map | Property Map | Property Map
- defines the specific alert criteria information.
- enabled Boolean
- the flag that indicates whether the metric alert is enabled.
- evaluation
Frequency String - how often the metric alert is evaluated represented in ISO 8601 duration format.
- resource
Group StringName - The name of the resource group. The name is case insensitive.
- scopes List<String>
- the list of resource id's that this metric alert is scoped to.
- severity Number
- Alert severity {0, 1, 2, 3, 4}
- window
Size String - the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold.
- actions List<Property Map>
- the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
- auto
Mitigate Boolean - the flag that indicates whether the alert should be auto resolved or not. The default is true.
- description String
- the description of the metric alert that will be included in the alert email.
- location String
- Resource location
- rule
Name String - The name of the rule.
- Map<String>
- Resource tags
- target
Resource StringRegion - the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
- target
Resource StringType - the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the MetricAlert resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Is
Migrated bool - the value indicating whether this alert rule is migrated.
- Last
Updated stringTime - Last time the rule was updated in ISO8601 format.
- Name string
- Azure resource name
- Type string
- Azure resource type
- Id string
- The provider-assigned unique ID for this managed resource.
- Is
Migrated bool - the value indicating whether this alert rule is migrated.
- Last
Updated stringTime - Last time the rule was updated in ISO8601 format.
- Name string
- Azure resource name
- Type string
- Azure resource type
- id String
- The provider-assigned unique ID for this managed resource.
- is
Migrated Boolean - the value indicating whether this alert rule is migrated.
- last
Updated StringTime - Last time the rule was updated in ISO8601 format.
- name String
- Azure resource name
- type String
- Azure resource type
- id string
- The provider-assigned unique ID for this managed resource.
- is
Migrated boolean - the value indicating whether this alert rule is migrated.
- last
Updated stringTime - Last time the rule was updated in ISO8601 format.
- name string
- Azure resource name
- type string
- Azure resource type
- id str
- The provider-assigned unique ID for this managed resource.
- is_
migrated bool - the value indicating whether this alert rule is migrated.
- last_
updated_ strtime - Last time the rule was updated in ISO8601 format.
- name str
- Azure resource name
- type str
- Azure resource type
- id String
- The provider-assigned unique ID for this managed resource.
- is
Migrated Boolean - the value indicating whether this alert rule is migrated.
- last
Updated StringTime - Last time the rule was updated in ISO8601 format.
- name String
- Azure resource name
- type String
- Azure resource type
Supporting Types
AggregationTypeEnum, AggregationTypeEnumArgs
- Average
- Average
- Count
- Count
- Minimum
- Minimum
- Maximum
- Maximum
- Total
- Total
- Aggregation
Type Enum Average - Average
- Aggregation
Type Enum Count - Count
- Aggregation
Type Enum Minimum - Minimum
- Aggregation
Type Enum Maximum - Maximum
- Aggregation
Type Enum Total - Total
- Average
- Average
- Count
- Count
- Minimum
- Minimum
- Maximum
- Maximum
- Total
- Total
- Average
- Average
- Count
- Count
- Minimum
- Minimum
- Maximum
- Maximum
- Total
- Total
- AVERAGE
- Average
- COUNT
- Count
- MINIMUM
- Minimum
- MAXIMUM
- Maximum
- TOTAL
- Total
- "Average"
- Average
- "Count"
- Count
- "Minimum"
- Minimum
- "Maximum"
- Maximum
- "Total"
- Total
DynamicMetricCriteria, DynamicMetricCriteriaArgs
- Alert
Sensitivity string | Pulumi.Azure Native. Insights. Dynamic Threshold Sensitivity - The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern.
- Failing
Periods Pulumi.Azure Native. Insights. Inputs. Dynamic Threshold Failing Periods - The minimum number of violations required within the selected lookback time window required to raise an alert.
- Metric
Name string - Name of the metric.
- Name string
- Name of the criteria.
- Operator
string | Pulumi.
Azure Native. Insights. Dynamic Threshold Operator - The operator used to compare the metric value against the threshold.
- Time
Aggregation string | Pulumi.Azure Native. Insights. Aggregation Type Enum - the criteria time aggregation types.
- Dimensions
List<Pulumi.
Azure Native. Insights. Inputs. Metric Dimension> - List of dimension conditions.
- Ignore
Data stringBefore - Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format)
- Metric
Namespace string - Namespace of the metric.
- Skip
Metric boolValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
- Alert
Sensitivity string | DynamicThreshold Sensitivity - The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern.
- Failing
Periods DynamicThreshold Failing Periods - The minimum number of violations required within the selected lookback time window required to raise an alert.
- Metric
Name string - Name of the metric.
- Name string
- Name of the criteria.
- Operator
string | Dynamic
Threshold Operator - The operator used to compare the metric value against the threshold.
- Time
Aggregation string | AggregationType Enum - the criteria time aggregation types.
- Dimensions
[]Metric
Dimension - List of dimension conditions.
- Ignore
Data stringBefore - Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format)
- Metric
Namespace string - Namespace of the metric.
- Skip
Metric boolValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
- alert
Sensitivity String | DynamicThreshold Sensitivity - The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern.
- failing
Periods DynamicThreshold Failing Periods - The minimum number of violations required within the selected lookback time window required to raise an alert.
- metric
Name String - Name of the metric.
- name String
- Name of the criteria.
- operator
String | Dynamic
Threshold Operator - The operator used to compare the metric value against the threshold.
- time
Aggregation String | AggregationType Enum - the criteria time aggregation types.
- dimensions
List<Metric
Dimension> - List of dimension conditions.
- ignore
Data StringBefore - Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format)
- metric
Namespace String - Namespace of the metric.
- skip
Metric BooleanValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
- alert
Sensitivity string | DynamicThreshold Sensitivity - The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern.
- failing
Periods DynamicThreshold Failing Periods - The minimum number of violations required within the selected lookback time window required to raise an alert.
- metric
Name string - Name of the metric.
- name string
- Name of the criteria.
- operator
string | Dynamic
Threshold Operator - The operator used to compare the metric value against the threshold.
- time
Aggregation string | AggregationType Enum - the criteria time aggregation types.
- dimensions
Metric
Dimension[] - List of dimension conditions.
- ignore
Data stringBefore - Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format)
- metric
Namespace string - Namespace of the metric.
- skip
Metric booleanValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
- alert_
sensitivity str | DynamicThreshold Sensitivity - The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern.
- failing_
periods DynamicThreshold Failing Periods - The minimum number of violations required within the selected lookback time window required to raise an alert.
- metric_
name str - Name of the metric.
- name str
- Name of the criteria.
- operator
str | Dynamic
Threshold Operator - The operator used to compare the metric value against the threshold.
- time_
aggregation str | AggregationType Enum - the criteria time aggregation types.
- dimensions
Sequence[Metric
Dimension] - List of dimension conditions.
- ignore_
data_ strbefore - Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format)
- metric_
namespace str - Namespace of the metric.
- skip_
metric_ boolvalidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
- alert
Sensitivity String | "Low" | "Medium" | "High" - The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern.
- failing
Periods Property Map - The minimum number of violations required within the selected lookback time window required to raise an alert.
- metric
Name String - Name of the metric.
- name String
- Name of the criteria.
- operator
String | "Greater
Than" | "Less Than" | "Greater Or Less Than" - The operator used to compare the metric value against the threshold.
- time
Aggregation String | "Average" | "Count" | "Minimum" | "Maximum" | "Total" - the criteria time aggregation types.
- dimensions List<Property Map>
- List of dimension conditions.
- ignore
Data StringBefore - Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format)
- metric
Namespace String - Namespace of the metric.
- skip
Metric BooleanValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
DynamicMetricCriteriaResponse, DynamicMetricCriteriaResponseArgs
- Alert
Sensitivity string - The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern.
- Failing
Periods Pulumi.Azure Native. Insights. Inputs. Dynamic Threshold Failing Periods Response - The minimum number of violations required within the selected lookback time window required to raise an alert.
- Metric
Name string - Name of the metric.
- Name string
- Name of the criteria.
- Operator string
- The operator used to compare the metric value against the threshold.
- Time
Aggregation string - the criteria time aggregation types.
- Dimensions
List<Pulumi.
Azure Native. Insights. Inputs. Metric Dimension Response> - List of dimension conditions.
- Ignore
Data stringBefore - Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format)
- Metric
Namespace string - Namespace of the metric.
- Skip
Metric boolValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
- Alert
Sensitivity string - The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern.
- Failing
Periods DynamicThreshold Failing Periods Response - The minimum number of violations required within the selected lookback time window required to raise an alert.
- Metric
Name string - Name of the metric.
- Name string
- Name of the criteria.
- Operator string
- The operator used to compare the metric value against the threshold.
- Time
Aggregation string - the criteria time aggregation types.
- Dimensions
[]Metric
Dimension Response - List of dimension conditions.
- Ignore
Data stringBefore - Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format)
- Metric
Namespace string - Namespace of the metric.
- Skip
Metric boolValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
- alert
Sensitivity String - The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern.
- failing
Periods DynamicThreshold Failing Periods Response - The minimum number of violations required within the selected lookback time window required to raise an alert.
- metric
Name String - Name of the metric.
- name String
- Name of the criteria.
- operator String
- The operator used to compare the metric value against the threshold.
- time
Aggregation String - the criteria time aggregation types.
- dimensions
List<Metric
Dimension Response> - List of dimension conditions.
- ignore
Data StringBefore - Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format)
- metric
Namespace String - Namespace of the metric.
- skip
Metric BooleanValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
- alert
Sensitivity string - The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern.
- failing
Periods DynamicThreshold Failing Periods Response - The minimum number of violations required within the selected lookback time window required to raise an alert.
- metric
Name string - Name of the metric.
- name string
- Name of the criteria.
- operator string
- The operator used to compare the metric value against the threshold.
- time
Aggregation string - the criteria time aggregation types.
- dimensions
Metric
Dimension Response[] - List of dimension conditions.
- ignore
Data stringBefore - Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format)
- metric
Namespace string - Namespace of the metric.
- skip
Metric booleanValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
- alert_
sensitivity str - The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern.
- failing_
periods DynamicThreshold Failing Periods Response - The minimum number of violations required within the selected lookback time window required to raise an alert.
- metric_
name str - Name of the metric.
- name str
- Name of the criteria.
- operator str
- The operator used to compare the metric value against the threshold.
- time_
aggregation str - the criteria time aggregation types.
- dimensions
Sequence[Metric
Dimension Response] - List of dimension conditions.
- ignore_
data_ strbefore - Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format)
- metric_
namespace str - Namespace of the metric.
- skip_
metric_ boolvalidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
- alert
Sensitivity String - The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern.
- failing
Periods Property Map - The minimum number of violations required within the selected lookback time window required to raise an alert.
- metric
Name String - Name of the metric.
- name String
- Name of the criteria.
- operator String
- The operator used to compare the metric value against the threshold.
- time
Aggregation String - the criteria time aggregation types.
- dimensions List<Property Map>
- List of dimension conditions.
- ignore
Data StringBefore - Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format)
- metric
Namespace String - Namespace of the metric.
- skip
Metric BooleanValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
DynamicThresholdFailingPeriods, DynamicThresholdFailingPeriodsArgs
- Min
Failing doublePeriods To Alert - The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods.
- Number
Of doubleEvaluation Periods - The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points.
- Min
Failing float64Periods To Alert - The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods.
- Number
Of float64Evaluation Periods - The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points.
- min
Failing DoublePeriods To Alert - The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods.
- number
Of DoubleEvaluation Periods - The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points.
- min
Failing numberPeriods To Alert - The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods.
- number
Of numberEvaluation Periods - The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points.
- min_
failing_ floatperiods_ to_ alert - The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods.
- number_
of_ floatevaluation_ periods - The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points.
- min
Failing NumberPeriods To Alert - The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods.
- number
Of NumberEvaluation Periods - The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points.
DynamicThresholdFailingPeriodsResponse, DynamicThresholdFailingPeriodsResponseArgs
- Min
Failing doublePeriods To Alert - The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods.
- Number
Of doubleEvaluation Periods - The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points.
- Min
Failing float64Periods To Alert - The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods.
- Number
Of float64Evaluation Periods - The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points.
- min
Failing DoublePeriods To Alert - The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods.
- number
Of DoubleEvaluation Periods - The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points.
- min
Failing numberPeriods To Alert - The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods.
- number
Of numberEvaluation Periods - The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points.
- min_
failing_ floatperiods_ to_ alert - The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods.
- number_
of_ floatevaluation_ periods - The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points.
- min
Failing NumberPeriods To Alert - The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods.
- number
Of NumberEvaluation Periods - The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points.
DynamicThresholdOperator, DynamicThresholdOperatorArgs
- Greater
Than - GreaterThan
- Less
Than - LessThan
- Greater
Or Less Than - GreaterOrLessThan
- Dynamic
Threshold Operator Greater Than - GreaterThan
- Dynamic
Threshold Operator Less Than - LessThan
- Dynamic
Threshold Operator Greater Or Less Than - GreaterOrLessThan
- Greater
Than - GreaterThan
- Less
Than - LessThan
- Greater
Or Less Than - GreaterOrLessThan
- Greater
Than - GreaterThan
- Less
Than - LessThan
- Greater
Or Less Than - GreaterOrLessThan
- GREATER_THAN
- GreaterThan
- LESS_THAN
- LessThan
- GREATER_OR_LESS_THAN
- GreaterOrLessThan
- "Greater
Than" - GreaterThan
- "Less
Than" - LessThan
- "Greater
Or Less Than" - GreaterOrLessThan
DynamicThresholdSensitivity, DynamicThresholdSensitivityArgs
- Low
- Low
- Medium
- Medium
- High
- High
- Dynamic
Threshold Sensitivity Low - Low
- Dynamic
Threshold Sensitivity Medium - Medium
- Dynamic
Threshold Sensitivity High - High
- Low
- Low
- Medium
- Medium
- High
- High
- Low
- Low
- Medium
- Medium
- High
- High
- LOW
- Low
- MEDIUM
- Medium
- HIGH
- High
- "Low"
- Low
- "Medium"
- Medium
- "High"
- High
MetricAlertAction, MetricAlertActionArgs
- Action
Group stringId - the id of the action group to use.
- Web
Hook Dictionary<string, string>Properties - This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook.
- Action
Group stringId - the id of the action group to use.
- Web
Hook map[string]stringProperties - This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook.
- action
Group StringId - the id of the action group to use.
- web
Hook Map<String,String>Properties - This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook.
- action
Group stringId - the id of the action group to use.
- web
Hook {[key: string]: string}Properties - This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook.
- action_
group_ strid - the id of the action group to use.
- web_
hook_ Mapping[str, str]properties - This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook.
- action
Group StringId - the id of the action group to use.
- web
Hook Map<String>Properties - This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook.
MetricAlertActionResponse, MetricAlertActionResponseArgs
- Action
Group stringId - the id of the action group to use.
- Web
Hook Dictionary<string, string>Properties - This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook.
- Action
Group stringId - the id of the action group to use.
- Web
Hook map[string]stringProperties - This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook.
- action
Group StringId - the id of the action group to use.
- web
Hook Map<String,String>Properties - This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook.
- action
Group stringId - the id of the action group to use.
- web
Hook {[key: string]: string}Properties - This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook.
- action_
group_ strid - the id of the action group to use.
- web_
hook_ Mapping[str, str]properties - This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook.
- action
Group StringId - the id of the action group to use.
- web
Hook Map<String>Properties - This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook.
MetricAlertMultipleResourceMultipleMetricCriteria, MetricAlertMultipleResourceMultipleMetricCriteriaArgs
- All
Of List<Union<Pulumi.Azure Native. Insights. Inputs. Dynamic Metric Criteria, Pulumi. Azure Native. Insights. Inputs. Metric Criteria>> - the list of multiple metric criteria for this 'all of' operation.
- All
Of []interface{} - the list of multiple metric criteria for this 'all of' operation.
- all
Of List<Either<DynamicMetric Criteria,Metric Criteria>> - the list of multiple metric criteria for this 'all of' operation.
- all
Of (DynamicMetric Criteria | Metric Criteria)[] - the list of multiple metric criteria for this 'all of' operation.
- all_
of Sequence[Union[DynamicMetric Criteria, Metric Criteria]] - the list of multiple metric criteria for this 'all of' operation.
- all
Of List<Property Map | Property Map> - the list of multiple metric criteria for this 'all of' operation.
MetricAlertMultipleResourceMultipleMetricCriteriaResponse, MetricAlertMultipleResourceMultipleMetricCriteriaResponseArgs
- All
Of List<Union<Pulumi.Azure Native. Insights. Inputs. Dynamic Metric Criteria Response, Pulumi. Azure Native. Insights. Inputs. Metric Criteria Response>> - the list of multiple metric criteria for this 'all of' operation.
- All
Of []interface{} - the list of multiple metric criteria for this 'all of' operation.
- all
Of List<Either<DynamicMetric Criteria Response,Metric Criteria Response>> - the list of multiple metric criteria for this 'all of' operation.
- all
Of (DynamicMetric Criteria Response | Metric Criteria Response)[] - the list of multiple metric criteria for this 'all of' operation.
- all_
of Sequence[Union[DynamicMetric Criteria Response, Metric Criteria Response]] - the list of multiple metric criteria for this 'all of' operation.
- all
Of List<Property Map | Property Map> - the list of multiple metric criteria for this 'all of' operation.
MetricAlertSingleResourceMultipleMetricCriteria, MetricAlertSingleResourceMultipleMetricCriteriaArgs
- All
Of List<Pulumi.Azure Native. Insights. Inputs. Metric Criteria> - The list of metric criteria for this 'all of' operation.
- All
Of []MetricCriteria - The list of metric criteria for this 'all of' operation.
- all
Of List<MetricCriteria> - The list of metric criteria for this 'all of' operation.
- all
Of MetricCriteria[] - The list of metric criteria for this 'all of' operation.
- all_
of Sequence[MetricCriteria] - The list of metric criteria for this 'all of' operation.
- all
Of List<Property Map> - The list of metric criteria for this 'all of' operation.
MetricAlertSingleResourceMultipleMetricCriteriaResponse, MetricAlertSingleResourceMultipleMetricCriteriaResponseArgs
- All
Of List<Pulumi.Azure Native. Insights. Inputs. Metric Criteria Response> - The list of metric criteria for this 'all of' operation.
- All
Of []MetricCriteria Response - The list of metric criteria for this 'all of' operation.
- all
Of List<MetricCriteria Response> - The list of metric criteria for this 'all of' operation.
- all
Of MetricCriteria Response[] - The list of metric criteria for this 'all of' operation.
- all_
of Sequence[MetricCriteria Response] - The list of metric criteria for this 'all of' operation.
- all
Of List<Property Map> - The list of metric criteria for this 'all of' operation.
MetricCriteria, MetricCriteriaArgs
- Metric
Name string - Name of the metric.
- Name string
- Name of the criteria.
- Operator
string | Pulumi.
Azure Native. Insights. Operator - the criteria operator.
- Threshold double
- the criteria threshold value that activates the alert.
- Time
Aggregation string | Pulumi.Azure Native. Insights. Aggregation Type Enum - the criteria time aggregation types.
- Dimensions
List<Pulumi.
Azure Native. Insights. Inputs. Metric Dimension> - List of dimension conditions.
- Metric
Namespace string - Namespace of the metric.
- Skip
Metric boolValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
- Metric
Name string - Name of the metric.
- Name string
- Name of the criteria.
- Operator string | Operator
- the criteria operator.
- Threshold float64
- the criteria threshold value that activates the alert.
- Time
Aggregation string | AggregationType Enum - the criteria time aggregation types.
- Dimensions
[]Metric
Dimension - List of dimension conditions.
- Metric
Namespace string - Namespace of the metric.
- Skip
Metric boolValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
- metric
Name String - Name of the metric.
- name String
- Name of the criteria.
- operator String | Operator
- the criteria operator.
- threshold Double
- the criteria threshold value that activates the alert.
- time
Aggregation String | AggregationType Enum - the criteria time aggregation types.
- dimensions
List<Metric
Dimension> - List of dimension conditions.
- metric
Namespace String - Namespace of the metric.
- skip
Metric BooleanValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
- metric
Name string - Name of the metric.
- name string
- Name of the criteria.
- operator string | Operator
- the criteria operator.
- threshold number
- the criteria threshold value that activates the alert.
- time
Aggregation string | AggregationType Enum - the criteria time aggregation types.
- dimensions
Metric
Dimension[] - List of dimension conditions.
- metric
Namespace string - Namespace of the metric.
- skip
Metric booleanValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
- metric_
name str - Name of the metric.
- name str
- Name of the criteria.
- operator str | Operator
- the criteria operator.
- threshold float
- the criteria threshold value that activates the alert.
- time_
aggregation str | AggregationType Enum - the criteria time aggregation types.
- dimensions
Sequence[Metric
Dimension] - List of dimension conditions.
- metric_
namespace str - Namespace of the metric.
- skip_
metric_ boolvalidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
- metric
Name String - Name of the metric.
- name String
- Name of the criteria.
- operator String | "Include"
- the criteria operator.
- threshold Number
- the criteria threshold value that activates the alert.
- time
Aggregation String | "Average" | "Count" | "Minimum" | "Maximum" | "Total" - the criteria time aggregation types.
- dimensions List<Property Map>
- List of dimension conditions.
- metric
Namespace String - Namespace of the metric.
- skip
Metric BooleanValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
MetricCriteriaResponse, MetricCriteriaResponseArgs
- Metric
Name string - Name of the metric.
- Name string
- Name of the criteria.
- Operator string
- the criteria operator.
- Threshold double
- the criteria threshold value that activates the alert.
- Time
Aggregation string - the criteria time aggregation types.
- Dimensions
List<Pulumi.
Azure Native. Insights. Inputs. Metric Dimension Response> - List of dimension conditions.
- Metric
Namespace string - Namespace of the metric.
- Skip
Metric boolValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
- Metric
Name string - Name of the metric.
- Name string
- Name of the criteria.
- Operator string
- the criteria operator.
- Threshold float64
- the criteria threshold value that activates the alert.
- Time
Aggregation string - the criteria time aggregation types.
- Dimensions
[]Metric
Dimension Response - List of dimension conditions.
- Metric
Namespace string - Namespace of the metric.
- Skip
Metric boolValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
- metric
Name String - Name of the metric.
- name String
- Name of the criteria.
- operator String
- the criteria operator.
- threshold Double
- the criteria threshold value that activates the alert.
- time
Aggregation String - the criteria time aggregation types.
- dimensions
List<Metric
Dimension Response> - List of dimension conditions.
- metric
Namespace String - Namespace of the metric.
- skip
Metric BooleanValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
- metric
Name string - Name of the metric.
- name string
- Name of the criteria.
- operator string
- the criteria operator.
- threshold number
- the criteria threshold value that activates the alert.
- time
Aggregation string - the criteria time aggregation types.
- dimensions
Metric
Dimension Response[] - List of dimension conditions.
- metric
Namespace string - Namespace of the metric.
- skip
Metric booleanValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
- metric_
name str - Name of the metric.
- name str
- Name of the criteria.
- operator str
- the criteria operator.
- threshold float
- the criteria threshold value that activates the alert.
- time_
aggregation str - the criteria time aggregation types.
- dimensions
Sequence[Metric
Dimension Response] - List of dimension conditions.
- metric_
namespace str - Namespace of the metric.
- skip_
metric_ boolvalidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
- metric
Name String - Name of the metric.
- name String
- Name of the criteria.
- operator String
- the criteria operator.
- threshold Number
- the criteria threshold value that activates the alert.
- time
Aggregation String - the criteria time aggregation types.
- dimensions List<Property Map>
- List of dimension conditions.
- metric
Namespace String - Namespace of the metric.
- skip
Metric BooleanValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
MetricDimension, MetricDimensionArgs
MetricDimensionResponse, MetricDimensionResponseArgs
Operator, OperatorArgs
- Include
- Include
- Operator
Include - Include
- Include
- Include
- Include
- Include
- INCLUDE
- Include
- "Include"
- Include
WebtestLocationAvailabilityCriteria, WebtestLocationAvailabilityCriteriaArgs
- Component
Id string - The Application Insights resource Id.
- Failed
Location doubleCount - The number of failed locations.
- Web
Test stringId - The Application Insights web test Id.
- Component
Id string - The Application Insights resource Id.
- Failed
Location float64Count - The number of failed locations.
- Web
Test stringId - The Application Insights web test Id.
- component
Id String - The Application Insights resource Id.
- failed
Location DoubleCount - The number of failed locations.
- web
Test StringId - The Application Insights web test Id.
- component
Id string - The Application Insights resource Id.
- failed
Location numberCount - The number of failed locations.
- web
Test stringId - The Application Insights web test Id.
- component_
id str - The Application Insights resource Id.
- failed_
location_ floatcount - The number of failed locations.
- web_
test_ strid - The Application Insights web test Id.
- component
Id String - The Application Insights resource Id.
- failed
Location NumberCount - The number of failed locations.
- web
Test StringId - The Application Insights web test Id.
WebtestLocationAvailabilityCriteriaResponse, WebtestLocationAvailabilityCriteriaResponseArgs
- Component
Id string - The Application Insights resource Id.
- Failed
Location doubleCount - The number of failed locations.
- Web
Test stringId - The Application Insights web test Id.
- Component
Id string - The Application Insights resource Id.
- Failed
Location float64Count - The number of failed locations.
- Web
Test stringId - The Application Insights web test Id.
- component
Id String - The Application Insights resource Id.
- failed
Location DoubleCount - The number of failed locations.
- web
Test StringId - The Application Insights web test Id.
- component
Id string - The Application Insights resource Id.
- failed
Location numberCount - The number of failed locations.
- web
Test stringId - The Application Insights web test Id.
- component_
id str - The Application Insights resource Id.
- failed_
location_ floatcount - The number of failed locations.
- web_
test_ strid - The Application Insights web test Id.
- component
Id String - The Application Insights resource Id.
- failed
Location NumberCount - The number of failed locations.
- web
Test StringId - The Application Insights web test Id.
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:insights:MetricAlert webtest-name-example /subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/MetricAlertWithDimensions
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- azure-native-v1 pulumi/pulumi-azure-native
- License
- Apache-2.0