We recommend using Azure Native.
azure.monitoring.MetricAlert
Explore with Pulumi AI
Manages a Metric Alert within Azure Monitor.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const toMonitor = new azure.storage.Account("to_monitor", {
name: "examplestorageaccount",
resourceGroupName: example.name,
location: example.location,
accountTier: "Standard",
accountReplicationType: "LRS",
});
const main = new azure.monitoring.ActionGroup("main", {
name: "example-actiongroup",
resourceGroupName: example.name,
shortName: "exampleact",
webhookReceivers: [{
name: "callmyapi",
serviceUri: "http://example.com/alert",
}],
});
const exampleMetricAlert = new azure.monitoring.MetricAlert("example", {
name: "example-metricalert",
resourceGroupName: example.name,
scopes: [toMonitor.id],
description: "Action will be triggered when Transactions count is greater than 50.",
criterias: [{
metricNamespace: "Microsoft.Storage/storageAccounts",
metricName: "Transactions",
aggregation: "Total",
operator: "GreaterThan",
threshold: 50,
dimensions: [{
name: "ApiName",
operator: "Include",
values: ["*"],
}],
}],
actions: [{
actionGroupId: main.id,
}],
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
to_monitor = azure.storage.Account("to_monitor",
name="examplestorageaccount",
resource_group_name=example.name,
location=example.location,
account_tier="Standard",
account_replication_type="LRS")
main = azure.monitoring.ActionGroup("main",
name="example-actiongroup",
resource_group_name=example.name,
short_name="exampleact",
webhook_receivers=[{
"name": "callmyapi",
"service_uri": "http://example.com/alert",
}])
example_metric_alert = azure.monitoring.MetricAlert("example",
name="example-metricalert",
resource_group_name=example.name,
scopes=[to_monitor.id],
description="Action will be triggered when Transactions count is greater than 50.",
criterias=[{
"metric_namespace": "Microsoft.Storage/storageAccounts",
"metric_name": "Transactions",
"aggregation": "Total",
"operator": "GreaterThan",
"threshold": 50,
"dimensions": [{
"name": "ApiName",
"operator": "Include",
"values": ["*"],
}],
}],
actions=[{
"action_group_id": main.id,
}])
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/monitoring"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/storage"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
toMonitor, err := storage.NewAccount(ctx, "to_monitor", &storage.AccountArgs{
Name: pulumi.String("examplestorageaccount"),
ResourceGroupName: example.Name,
Location: example.Location,
AccountTier: pulumi.String("Standard"),
AccountReplicationType: pulumi.String("LRS"),
})
if err != nil {
return err
}
main, err := monitoring.NewActionGroup(ctx, "main", &monitoring.ActionGroupArgs{
Name: pulumi.String("example-actiongroup"),
ResourceGroupName: example.Name,
ShortName: pulumi.String("exampleact"),
WebhookReceivers: monitoring.ActionGroupWebhookReceiverArray{
&monitoring.ActionGroupWebhookReceiverArgs{
Name: pulumi.String("callmyapi"),
ServiceUri: pulumi.String("http://example.com/alert"),
},
},
})
if err != nil {
return err
}
_, err = monitoring.NewMetricAlert(ctx, "example", &monitoring.MetricAlertArgs{
Name: pulumi.String("example-metricalert"),
ResourceGroupName: example.Name,
Scopes: pulumi.StringArray{
toMonitor.ID(),
},
Description: pulumi.String("Action will be triggered when Transactions count is greater than 50."),
Criterias: monitoring.MetricAlertCriteriaArray{
&monitoring.MetricAlertCriteriaArgs{
MetricNamespace: pulumi.String("Microsoft.Storage/storageAccounts"),
MetricName: pulumi.String("Transactions"),
Aggregation: pulumi.String("Total"),
Operator: pulumi.String("GreaterThan"),
Threshold: pulumi.Float64(50),
Dimensions: monitoring.MetricAlertCriteriaDimensionArray{
&monitoring.MetricAlertCriteriaDimensionArgs{
Name: pulumi.String("ApiName"),
Operator: pulumi.String("Include"),
Values: pulumi.StringArray{
pulumi.String("*"),
},
},
},
},
},
Actions: monitoring.MetricAlertActionArray{
&monitoring.MetricAlertActionArgs{
ActionGroupId: main.ID(),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "example-resources",
Location = "West Europe",
});
var toMonitor = new Azure.Storage.Account("to_monitor", new()
{
Name = "examplestorageaccount",
ResourceGroupName = example.Name,
Location = example.Location,
AccountTier = "Standard",
AccountReplicationType = "LRS",
});
var main = new Azure.Monitoring.ActionGroup("main", new()
{
Name = "example-actiongroup",
ResourceGroupName = example.Name,
ShortName = "exampleact",
WebhookReceivers = new[]
{
new Azure.Monitoring.Inputs.ActionGroupWebhookReceiverArgs
{
Name = "callmyapi",
ServiceUri = "http://example.com/alert",
},
},
});
var exampleMetricAlert = new Azure.Monitoring.MetricAlert("example", new()
{
Name = "example-metricalert",
ResourceGroupName = example.Name,
Scopes = new[]
{
toMonitor.Id,
},
Description = "Action will be triggered when Transactions count is greater than 50.",
Criterias = new[]
{
new Azure.Monitoring.Inputs.MetricAlertCriteriaArgs
{
MetricNamespace = "Microsoft.Storage/storageAccounts",
MetricName = "Transactions",
Aggregation = "Total",
Operator = "GreaterThan",
Threshold = 50,
Dimensions = new[]
{
new Azure.Monitoring.Inputs.MetricAlertCriteriaDimensionArgs
{
Name = "ApiName",
Operator = "Include",
Values = new[]
{
"*",
},
},
},
},
},
Actions = new[]
{
new Azure.Monitoring.Inputs.MetricAlertActionArgs
{
ActionGroupId = main.Id,
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.storage.Account;
import com.pulumi.azure.storage.AccountArgs;
import com.pulumi.azure.monitoring.ActionGroup;
import com.pulumi.azure.monitoring.ActionGroupArgs;
import com.pulumi.azure.monitoring.inputs.ActionGroupWebhookReceiverArgs;
import com.pulumi.azure.monitoring.MetricAlert;
import com.pulumi.azure.monitoring.MetricAlertArgs;
import com.pulumi.azure.monitoring.inputs.MetricAlertCriteriaArgs;
import com.pulumi.azure.monitoring.inputs.MetricAlertActionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-resources")
.location("West Europe")
.build());
var toMonitor = new Account("toMonitor", AccountArgs.builder()
.name("examplestorageaccount")
.resourceGroupName(example.name())
.location(example.location())
.accountTier("Standard")
.accountReplicationType("LRS")
.build());
var main = new ActionGroup("main", ActionGroupArgs.builder()
.name("example-actiongroup")
.resourceGroupName(example.name())
.shortName("exampleact")
.webhookReceivers(ActionGroupWebhookReceiverArgs.builder()
.name("callmyapi")
.serviceUri("http://example.com/alert")
.build())
.build());
var exampleMetricAlert = new MetricAlert("exampleMetricAlert", MetricAlertArgs.builder()
.name("example-metricalert")
.resourceGroupName(example.name())
.scopes(toMonitor.id())
.description("Action will be triggered when Transactions count is greater than 50.")
.criterias(MetricAlertCriteriaArgs.builder()
.metricNamespace("Microsoft.Storage/storageAccounts")
.metricName("Transactions")
.aggregation("Total")
.operator("GreaterThan")
.threshold(50)
.dimensions(MetricAlertCriteriaDimensionArgs.builder()
.name("ApiName")
.operator("Include")
.values("*")
.build())
.build())
.actions(MetricAlertActionArgs.builder()
.actionGroupId(main.id())
.build())
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
toMonitor:
type: azure:storage:Account
name: to_monitor
properties:
name: examplestorageaccount
resourceGroupName: ${example.name}
location: ${example.location}
accountTier: Standard
accountReplicationType: LRS
main:
type: azure:monitoring:ActionGroup
properties:
name: example-actiongroup
resourceGroupName: ${example.name}
shortName: exampleact
webhookReceivers:
- name: callmyapi
serviceUri: http://example.com/alert
exampleMetricAlert:
type: azure:monitoring:MetricAlert
name: example
properties:
name: example-metricalert
resourceGroupName: ${example.name}
scopes:
- ${toMonitor.id}
description: Action will be triggered when Transactions count is greater than 50.
criterias:
- metricNamespace: Microsoft.Storage/storageAccounts
metricName: Transactions
aggregation: Total
operator: GreaterThan
threshold: 50
dimensions:
- name: ApiName
operator: Include
values:
- '*'
actions:
- actionGroupId: ${main.id}
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,
scopes: Optional[Sequence[str]] = None,
name: Optional[str] = None,
auto_mitigate: Optional[bool] = None,
description: Optional[str] = None,
dynamic_criteria: Optional[MetricAlertDynamicCriteriaArgs] = None,
enabled: Optional[bool] = None,
frequency: Optional[str] = None,
actions: Optional[Sequence[MetricAlertActionArgs]] = None,
criterias: Optional[Sequence[MetricAlertCriteriaArgs]] = None,
application_insights_web_test_location_availability_criteria: Optional[MetricAlertApplicationInsightsWebTestLocationAvailabilityCriteriaArgs] = None,
severity: Optional[int] = None,
tags: Optional[Mapping[str, str]] = None,
target_resource_location: Optional[str] = None,
target_resource_type: Optional[str] = None,
window_size: Optional[str] = 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:monitoring: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 Azure.Monitoring.MetricAlert("metricAlertResource", new()
{
ResourceGroupName = "string",
Scopes = new[]
{
"string",
},
Name = "string",
AutoMitigate = false,
Description = "string",
DynamicCriteria = new Azure.Monitoring.Inputs.MetricAlertDynamicCriteriaArgs
{
Aggregation = "string",
AlertSensitivity = "string",
MetricName = "string",
MetricNamespace = "string",
Operator = "string",
Dimensions = new[]
{
new Azure.Monitoring.Inputs.MetricAlertDynamicCriteriaDimensionArgs
{
Name = "string",
Operator = "string",
Values = new[]
{
"string",
},
},
},
EvaluationFailureCount = 0,
EvaluationTotalCount = 0,
IgnoreDataBefore = "string",
SkipMetricValidation = false,
},
Enabled = false,
Frequency = "string",
Actions = new[]
{
new Azure.Monitoring.Inputs.MetricAlertActionArgs
{
ActionGroupId = "string",
WebhookProperties =
{
{ "string", "string" },
},
},
},
Criterias = new[]
{
new Azure.Monitoring.Inputs.MetricAlertCriteriaArgs
{
Aggregation = "string",
MetricName = "string",
MetricNamespace = "string",
Operator = "string",
Threshold = 0,
Dimensions = new[]
{
new Azure.Monitoring.Inputs.MetricAlertCriteriaDimensionArgs
{
Name = "string",
Operator = "string",
Values = new[]
{
"string",
},
},
},
SkipMetricValidation = false,
},
},
ApplicationInsightsWebTestLocationAvailabilityCriteria = new Azure.Monitoring.Inputs.MetricAlertApplicationInsightsWebTestLocationAvailabilityCriteriaArgs
{
ComponentId = "string",
FailedLocationCount = 0,
WebTestId = "string",
},
Severity = 0,
Tags =
{
{ "string", "string" },
},
TargetResourceLocation = "string",
TargetResourceType = "string",
WindowSize = "string",
});
example, err := monitoring.NewMetricAlert(ctx, "metricAlertResource", &monitoring.MetricAlertArgs{
ResourceGroupName: pulumi.String("string"),
Scopes: pulumi.StringArray{
pulumi.String("string"),
},
Name: pulumi.String("string"),
AutoMitigate: pulumi.Bool(false),
Description: pulumi.String("string"),
DynamicCriteria: &monitoring.MetricAlertDynamicCriteriaArgs{
Aggregation: pulumi.String("string"),
AlertSensitivity: pulumi.String("string"),
MetricName: pulumi.String("string"),
MetricNamespace: pulumi.String("string"),
Operator: pulumi.String("string"),
Dimensions: monitoring.MetricAlertDynamicCriteriaDimensionArray{
&monitoring.MetricAlertDynamicCriteriaDimensionArgs{
Name: pulumi.String("string"),
Operator: pulumi.String("string"),
Values: pulumi.StringArray{
pulumi.String("string"),
},
},
},
EvaluationFailureCount: pulumi.Int(0),
EvaluationTotalCount: pulumi.Int(0),
IgnoreDataBefore: pulumi.String("string"),
SkipMetricValidation: pulumi.Bool(false),
},
Enabled: pulumi.Bool(false),
Frequency: pulumi.String("string"),
Actions: monitoring.MetricAlertActionArray{
&monitoring.MetricAlertActionArgs{
ActionGroupId: pulumi.String("string"),
WebhookProperties: pulumi.StringMap{
"string": pulumi.String("string"),
},
},
},
Criterias: monitoring.MetricAlertCriteriaArray{
&monitoring.MetricAlertCriteriaArgs{
Aggregation: pulumi.String("string"),
MetricName: pulumi.String("string"),
MetricNamespace: pulumi.String("string"),
Operator: pulumi.String("string"),
Threshold: pulumi.Float64(0),
Dimensions: monitoring.MetricAlertCriteriaDimensionArray{
&monitoring.MetricAlertCriteriaDimensionArgs{
Name: pulumi.String("string"),
Operator: pulumi.String("string"),
Values: pulumi.StringArray{
pulumi.String("string"),
},
},
},
SkipMetricValidation: pulumi.Bool(false),
},
},
ApplicationInsightsWebTestLocationAvailabilityCriteria: &monitoring.MetricAlertApplicationInsightsWebTestLocationAvailabilityCriteriaArgs{
ComponentId: pulumi.String("string"),
FailedLocationCount: pulumi.Int(0),
WebTestId: pulumi.String("string"),
},
Severity: pulumi.Int(0),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
TargetResourceLocation: pulumi.String("string"),
TargetResourceType: pulumi.String("string"),
WindowSize: pulumi.String("string"),
})
var metricAlertResource = new MetricAlert("metricAlertResource", MetricAlertArgs.builder()
.resourceGroupName("string")
.scopes("string")
.name("string")
.autoMitigate(false)
.description("string")
.dynamicCriteria(MetricAlertDynamicCriteriaArgs.builder()
.aggregation("string")
.alertSensitivity("string")
.metricName("string")
.metricNamespace("string")
.operator("string")
.dimensions(MetricAlertDynamicCriteriaDimensionArgs.builder()
.name("string")
.operator("string")
.values("string")
.build())
.evaluationFailureCount(0)
.evaluationTotalCount(0)
.ignoreDataBefore("string")
.skipMetricValidation(false)
.build())
.enabled(false)
.frequency("string")
.actions(MetricAlertActionArgs.builder()
.actionGroupId("string")
.webhookProperties(Map.of("string", "string"))
.build())
.criterias(MetricAlertCriteriaArgs.builder()
.aggregation("string")
.metricName("string")
.metricNamespace("string")
.operator("string")
.threshold(0)
.dimensions(MetricAlertCriteriaDimensionArgs.builder()
.name("string")
.operator("string")
.values("string")
.build())
.skipMetricValidation(false)
.build())
.applicationInsightsWebTestLocationAvailabilityCriteria(MetricAlertApplicationInsightsWebTestLocationAvailabilityCriteriaArgs.builder()
.componentId("string")
.failedLocationCount(0)
.webTestId("string")
.build())
.severity(0)
.tags(Map.of("string", "string"))
.targetResourceLocation("string")
.targetResourceType("string")
.windowSize("string")
.build());
metric_alert_resource = azure.monitoring.MetricAlert("metricAlertResource",
resource_group_name="string",
scopes=["string"],
name="string",
auto_mitigate=False,
description="string",
dynamic_criteria={
"aggregation": "string",
"alert_sensitivity": "string",
"metric_name": "string",
"metric_namespace": "string",
"operator": "string",
"dimensions": [{
"name": "string",
"operator": "string",
"values": ["string"],
}],
"evaluation_failure_count": 0,
"evaluation_total_count": 0,
"ignore_data_before": "string",
"skip_metric_validation": False,
},
enabled=False,
frequency="string",
actions=[{
"action_group_id": "string",
"webhook_properties": {
"string": "string",
},
}],
criterias=[{
"aggregation": "string",
"metric_name": "string",
"metric_namespace": "string",
"operator": "string",
"threshold": 0,
"dimensions": [{
"name": "string",
"operator": "string",
"values": ["string"],
}],
"skip_metric_validation": False,
}],
application_insights_web_test_location_availability_criteria={
"component_id": "string",
"failed_location_count": 0,
"web_test_id": "string",
},
severity=0,
tags={
"string": "string",
},
target_resource_location="string",
target_resource_type="string",
window_size="string")
const metricAlertResource = new azure.monitoring.MetricAlert("metricAlertResource", {
resourceGroupName: "string",
scopes: ["string"],
name: "string",
autoMitigate: false,
description: "string",
dynamicCriteria: {
aggregation: "string",
alertSensitivity: "string",
metricName: "string",
metricNamespace: "string",
operator: "string",
dimensions: [{
name: "string",
operator: "string",
values: ["string"],
}],
evaluationFailureCount: 0,
evaluationTotalCount: 0,
ignoreDataBefore: "string",
skipMetricValidation: false,
},
enabled: false,
frequency: "string",
actions: [{
actionGroupId: "string",
webhookProperties: {
string: "string",
},
}],
criterias: [{
aggregation: "string",
metricName: "string",
metricNamespace: "string",
operator: "string",
threshold: 0,
dimensions: [{
name: "string",
operator: "string",
values: ["string"],
}],
skipMetricValidation: false,
}],
applicationInsightsWebTestLocationAvailabilityCriteria: {
componentId: "string",
failedLocationCount: 0,
webTestId: "string",
},
severity: 0,
tags: {
string: "string",
},
targetResourceLocation: "string",
targetResourceType: "string",
windowSize: "string",
});
type: azure:monitoring:MetricAlert
properties:
actions:
- actionGroupId: string
webhookProperties:
string: string
applicationInsightsWebTestLocationAvailabilityCriteria:
componentId: string
failedLocationCount: 0
webTestId: string
autoMitigate: false
criterias:
- aggregation: string
dimensions:
- name: string
operator: string
values:
- string
metricName: string
metricNamespace: string
operator: string
skipMetricValidation: false
threshold: 0
description: string
dynamicCriteria:
aggregation: string
alertSensitivity: string
dimensions:
- name: string
operator: string
values:
- string
evaluationFailureCount: 0
evaluationTotalCount: 0
ignoreDataBefore: string
metricName: string
metricNamespace: string
operator: string
skipMetricValidation: false
enabled: false
frequency: string
name: string
resourceGroupName: string
scopes:
- string
severity: 0
tags:
string: string
targetResourceLocation: 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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The MetricAlert resource accepts the following input properties:
- Resource
Group stringName - The name of the resource group in which to create the Metric Alert instance. Changing this forces a new resource to be created.
- Scopes List<string>
- A set of strings of resource IDs at which the metric criteria should be applied.
- Actions
List<Metric
Alert Action> - One or more
action
blocks as defined below. - Metric
Alert Application Insights Web Test Location Availability Criteria A
application_insights_web_test_location_availability_criteria
block as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- Auto
Mitigate bool - Should the alerts in this Metric Alert be auto resolved? Defaults to
true
. - Criterias
List<Metric
Alert Criteria> One or more (static)
criteria
blocks as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- Description string
- The description of this Metric Alert.
- Dynamic
Criteria MetricAlert Dynamic Criteria A
dynamic_criteria
block as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- Enabled bool
- Should this Metric Alert be enabled? Defaults to
true
. - Frequency string
- The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are
PT1M
,PT5M
,PT15M
,PT30M
andPT1H
. Defaults toPT1M
. - Name string
- The name of the Metric Alert. Changing this forces a new resource to be created.
- Severity int
- The severity of this Metric Alert. Possible values are
0
,1
,2
,3
and4
. Defaults to3
. - Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Target
Resource stringLocation The location of the target resource.
This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
- Target
Resource stringType The resource type (e.g.
Microsoft.Compute/virtualMachines
) of the target resource.This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
- Window
Size string - The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than
frequency
. Possible values arePT1M
,PT5M
,PT15M
,PT30M
,PT1H
,PT6H
,PT12H
andP1D
. Defaults toPT5M
.
- Resource
Group stringName - The name of the resource group in which to create the Metric Alert instance. Changing this forces a new resource to be created.
- Scopes []string
- A set of strings of resource IDs at which the metric criteria should be applied.
- Actions
[]Metric
Alert Action Args - One or more
action
blocks as defined below. - Metric
Alert Application Insights Web Test Location Availability Criteria Args A
application_insights_web_test_location_availability_criteria
block as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- Auto
Mitigate bool - Should the alerts in this Metric Alert be auto resolved? Defaults to
true
. - Criterias
[]Metric
Alert Criteria Args One or more (static)
criteria
blocks as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- Description string
- The description of this Metric Alert.
- Dynamic
Criteria MetricAlert Dynamic Criteria Args A
dynamic_criteria
block as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- Enabled bool
- Should this Metric Alert be enabled? Defaults to
true
. - Frequency string
- The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are
PT1M
,PT5M
,PT15M
,PT30M
andPT1H
. Defaults toPT1M
. - Name string
- The name of the Metric Alert. Changing this forces a new resource to be created.
- Severity int
- The severity of this Metric Alert. Possible values are
0
,1
,2
,3
and4
. Defaults to3
. - map[string]string
- A mapping of tags to assign to the resource.
- Target
Resource stringLocation The location of the target resource.
This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
- Target
Resource stringType The resource type (e.g.
Microsoft.Compute/virtualMachines
) of the target resource.This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
- Window
Size string - The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than
frequency
. Possible values arePT1M
,PT5M
,PT15M
,PT30M
,PT1H
,PT6H
,PT12H
andP1D
. Defaults toPT5M
.
- resource
Group StringName - The name of the resource group in which to create the Metric Alert instance. Changing this forces a new resource to be created.
- scopes List<String>
- A set of strings of resource IDs at which the metric criteria should be applied.
- actions
List<Metric
Alert Action> - One or more
action
blocks as defined below. - Metric
Alert Application Insights Web Test Location Availability Criteria A
application_insights_web_test_location_availability_criteria
block as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- auto
Mitigate Boolean - Should the alerts in this Metric Alert be auto resolved? Defaults to
true
. - criterias
List<Metric
Alert Criteria> One or more (static)
criteria
blocks as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- description String
- The description of this Metric Alert.
- dynamic
Criteria MetricAlert Dynamic Criteria A
dynamic_criteria
block as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- enabled Boolean
- Should this Metric Alert be enabled? Defaults to
true
. - frequency String
- The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are
PT1M
,PT5M
,PT15M
,PT30M
andPT1H
. Defaults toPT1M
. - name String
- The name of the Metric Alert. Changing this forces a new resource to be created.
- severity Integer
- The severity of this Metric Alert. Possible values are
0
,1
,2
,3
and4
. Defaults to3
. - Map<String,String>
- A mapping of tags to assign to the resource.
- target
Resource StringLocation The location of the target resource.
This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
- target
Resource StringType The resource type (e.g.
Microsoft.Compute/virtualMachines
) of the target resource.This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
- window
Size String - The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than
frequency
. Possible values arePT1M
,PT5M
,PT15M
,PT30M
,PT1H
,PT6H
,PT12H
andP1D
. Defaults toPT5M
.
- resource
Group stringName - The name of the resource group in which to create the Metric Alert instance. Changing this forces a new resource to be created.
- scopes string[]
- A set of strings of resource IDs at which the metric criteria should be applied.
- actions
Metric
Alert Action[] - One or more
action
blocks as defined below. - Metric
Alert Application Insights Web Test Location Availability Criteria A
application_insights_web_test_location_availability_criteria
block as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- auto
Mitigate boolean - Should the alerts in this Metric Alert be auto resolved? Defaults to
true
. - criterias
Metric
Alert Criteria[] One or more (static)
criteria
blocks as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- description string
- The description of this Metric Alert.
- dynamic
Criteria MetricAlert Dynamic Criteria A
dynamic_criteria
block as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- enabled boolean
- Should this Metric Alert be enabled? Defaults to
true
. - frequency string
- The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are
PT1M
,PT5M
,PT15M
,PT30M
andPT1H
. Defaults toPT1M
. - name string
- The name of the Metric Alert. Changing this forces a new resource to be created.
- severity number
- The severity of this Metric Alert. Possible values are
0
,1
,2
,3
and4
. Defaults to3
. - {[key: string]: string}
- A mapping of tags to assign to the resource.
- target
Resource stringLocation The location of the target resource.
This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
- target
Resource stringType The resource type (e.g.
Microsoft.Compute/virtualMachines
) of the target resource.This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
- window
Size string - The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than
frequency
. Possible values arePT1M
,PT5M
,PT15M
,PT30M
,PT1H
,PT6H
,PT12H
andP1D
. Defaults toPT5M
.
- resource_
group_ strname - The name of the resource group in which to create the Metric Alert instance. Changing this forces a new resource to be created.
- scopes Sequence[str]
- A set of strings of resource IDs at which the metric criteria should be applied.
- actions
Sequence[Metric
Alert Action Args] - One or more
action
blocks as defined below. - application_
insights_ Metricweb_ test_ location_ availability_ criteria Alert Application Insights Web Test Location Availability Criteria Args A
application_insights_web_test_location_availability_criteria
block as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- auto_
mitigate bool - Should the alerts in this Metric Alert be auto resolved? Defaults to
true
. - criterias
Sequence[Metric
Alert Criteria Args] One or more (static)
criteria
blocks as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- description str
- The description of this Metric Alert.
- dynamic_
criteria MetricAlert Dynamic Criteria Args A
dynamic_criteria
block as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- enabled bool
- Should this Metric Alert be enabled? Defaults to
true
. - frequency str
- The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are
PT1M
,PT5M
,PT15M
,PT30M
andPT1H
. Defaults toPT1M
. - name str
- The name of the Metric Alert. Changing this forces a new resource to be created.
- severity int
- The severity of this Metric Alert. Possible values are
0
,1
,2
,3
and4
. Defaults to3
. - Mapping[str, str]
- A mapping of tags to assign to the resource.
- target_
resource_ strlocation The location of the target resource.
This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
- target_
resource_ strtype The resource type (e.g.
Microsoft.Compute/virtualMachines
) of the target resource.This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
- window_
size str - The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than
frequency
. Possible values arePT1M
,PT5M
,PT15M
,PT30M
,PT1H
,PT6H
,PT12H
andP1D
. Defaults toPT5M
.
- resource
Group StringName - The name of the resource group in which to create the Metric Alert instance. Changing this forces a new resource to be created.
- scopes List<String>
- A set of strings of resource IDs at which the metric criteria should be applied.
- actions List<Property Map>
- One or more
action
blocks as defined below. - Property Map
A
application_insights_web_test_location_availability_criteria
block as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- auto
Mitigate Boolean - Should the alerts in this Metric Alert be auto resolved? Defaults to
true
. - criterias List<Property Map>
One or more (static)
criteria
blocks as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- description String
- The description of this Metric Alert.
- dynamic
Criteria Property Map A
dynamic_criteria
block as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- enabled Boolean
- Should this Metric Alert be enabled? Defaults to
true
. - frequency String
- The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are
PT1M
,PT5M
,PT15M
,PT30M
andPT1H
. Defaults toPT1M
. - name String
- The name of the Metric Alert. Changing this forces a new resource to be created.
- severity Number
- The severity of this Metric Alert. Possible values are
0
,1
,2
,3
and4
. Defaults to3
. - Map<String>
- A mapping of tags to assign to the resource.
- target
Resource StringLocation The location of the target resource.
This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
- target
Resource StringType The resource type (e.g.
Microsoft.Compute/virtualMachines
) of the target resource.This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
- window
Size String - The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than
frequency
. Possible values arePT1M
,PT5M
,PT15M
,PT30M
,PT1H
,PT6H
,PT12H
andP1D
. Defaults toPT5M
.
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.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing MetricAlert Resource
Get an existing MetricAlert resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: MetricAlertState, opts?: CustomResourceOptions): MetricAlert
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
actions: Optional[Sequence[MetricAlertActionArgs]] = None,
application_insights_web_test_location_availability_criteria: Optional[MetricAlertApplicationInsightsWebTestLocationAvailabilityCriteriaArgs] = None,
auto_mitigate: Optional[bool] = None,
criterias: Optional[Sequence[MetricAlertCriteriaArgs]] = None,
description: Optional[str] = None,
dynamic_criteria: Optional[MetricAlertDynamicCriteriaArgs] = None,
enabled: Optional[bool] = None,
frequency: Optional[str] = None,
name: Optional[str] = None,
resource_group_name: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
severity: Optional[int] = None,
tags: Optional[Mapping[str, str]] = None,
target_resource_location: Optional[str] = None,
target_resource_type: Optional[str] = None,
window_size: Optional[str] = None) -> MetricAlert
func GetMetricAlert(ctx *Context, name string, id IDInput, state *MetricAlertState, opts ...ResourceOption) (*MetricAlert, error)
public static MetricAlert Get(string name, Input<string> id, MetricAlertState? state, CustomResourceOptions? opts = null)
public static MetricAlert get(String name, Output<String> id, MetricAlertState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Actions
List<Metric
Alert Action> - One or more
action
blocks as defined below. - Metric
Alert Application Insights Web Test Location Availability Criteria A
application_insights_web_test_location_availability_criteria
block as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- Auto
Mitigate bool - Should the alerts in this Metric Alert be auto resolved? Defaults to
true
. - Criterias
List<Metric
Alert Criteria> One or more (static)
criteria
blocks as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- Description string
- The description of this Metric Alert.
- Dynamic
Criteria MetricAlert Dynamic Criteria A
dynamic_criteria
block as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- Enabled bool
- Should this Metric Alert be enabled? Defaults to
true
. - Frequency string
- The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are
PT1M
,PT5M
,PT15M
,PT30M
andPT1H
. Defaults toPT1M
. - Name string
- The name of the Metric Alert. Changing this forces a new resource to be created.
- Resource
Group stringName - The name of the resource group in which to create the Metric Alert instance. Changing this forces a new resource to be created.
- Scopes List<string>
- A set of strings of resource IDs at which the metric criteria should be applied.
- Severity int
- The severity of this Metric Alert. Possible values are
0
,1
,2
,3
and4
. Defaults to3
. - Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Target
Resource stringLocation The location of the target resource.
This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
- Target
Resource stringType The resource type (e.g.
Microsoft.Compute/virtualMachines
) of the target resource.This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
- Window
Size string - The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than
frequency
. Possible values arePT1M
,PT5M
,PT15M
,PT30M
,PT1H
,PT6H
,PT12H
andP1D
. Defaults toPT5M
.
- Actions
[]Metric
Alert Action Args - One or more
action
blocks as defined below. - Metric
Alert Application Insights Web Test Location Availability Criteria Args A
application_insights_web_test_location_availability_criteria
block as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- Auto
Mitigate bool - Should the alerts in this Metric Alert be auto resolved? Defaults to
true
. - Criterias
[]Metric
Alert Criteria Args One or more (static)
criteria
blocks as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- Description string
- The description of this Metric Alert.
- Dynamic
Criteria MetricAlert Dynamic Criteria Args A
dynamic_criteria
block as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- Enabled bool
- Should this Metric Alert be enabled? Defaults to
true
. - Frequency string
- The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are
PT1M
,PT5M
,PT15M
,PT30M
andPT1H
. Defaults toPT1M
. - Name string
- The name of the Metric Alert. Changing this forces a new resource to be created.
- Resource
Group stringName - The name of the resource group in which to create the Metric Alert instance. Changing this forces a new resource to be created.
- Scopes []string
- A set of strings of resource IDs at which the metric criteria should be applied.
- Severity int
- The severity of this Metric Alert. Possible values are
0
,1
,2
,3
and4
. Defaults to3
. - map[string]string
- A mapping of tags to assign to the resource.
- Target
Resource stringLocation The location of the target resource.
This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
- Target
Resource stringType The resource type (e.g.
Microsoft.Compute/virtualMachines
) of the target resource.This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
- Window
Size string - The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than
frequency
. Possible values arePT1M
,PT5M
,PT15M
,PT30M
,PT1H
,PT6H
,PT12H
andP1D
. Defaults toPT5M
.
- actions
List<Metric
Alert Action> - One or more
action
blocks as defined below. - Metric
Alert Application Insights Web Test Location Availability Criteria A
application_insights_web_test_location_availability_criteria
block as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- auto
Mitigate Boolean - Should the alerts in this Metric Alert be auto resolved? Defaults to
true
. - criterias
List<Metric
Alert Criteria> One or more (static)
criteria
blocks as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- description String
- The description of this Metric Alert.
- dynamic
Criteria MetricAlert Dynamic Criteria A
dynamic_criteria
block as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- enabled Boolean
- Should this Metric Alert be enabled? Defaults to
true
. - frequency String
- The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are
PT1M
,PT5M
,PT15M
,PT30M
andPT1H
. Defaults toPT1M
. - name String
- The name of the Metric Alert. Changing this forces a new resource to be created.
- resource
Group StringName - The name of the resource group in which to create the Metric Alert instance. Changing this forces a new resource to be created.
- scopes List<String>
- A set of strings of resource IDs at which the metric criteria should be applied.
- severity Integer
- The severity of this Metric Alert. Possible values are
0
,1
,2
,3
and4
. Defaults to3
. - Map<String,String>
- A mapping of tags to assign to the resource.
- target
Resource StringLocation The location of the target resource.
This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
- target
Resource StringType The resource type (e.g.
Microsoft.Compute/virtualMachines
) of the target resource.This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
- window
Size String - The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than
frequency
. Possible values arePT1M
,PT5M
,PT15M
,PT30M
,PT1H
,PT6H
,PT12H
andP1D
. Defaults toPT5M
.
- actions
Metric
Alert Action[] - One or more
action
blocks as defined below. - Metric
Alert Application Insights Web Test Location Availability Criteria A
application_insights_web_test_location_availability_criteria
block as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- auto
Mitigate boolean - Should the alerts in this Metric Alert be auto resolved? Defaults to
true
. - criterias
Metric
Alert Criteria[] One or more (static)
criteria
blocks as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- description string
- The description of this Metric Alert.
- dynamic
Criteria MetricAlert Dynamic Criteria A
dynamic_criteria
block as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- enabled boolean
- Should this Metric Alert be enabled? Defaults to
true
. - frequency string
- The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are
PT1M
,PT5M
,PT15M
,PT30M
andPT1H
. Defaults toPT1M
. - name string
- The name of the Metric Alert. Changing this forces a new resource to be created.
- resource
Group stringName - The name of the resource group in which to create the Metric Alert instance. Changing this forces a new resource to be created.
- scopes string[]
- A set of strings of resource IDs at which the metric criteria should be applied.
- severity number
- The severity of this Metric Alert. Possible values are
0
,1
,2
,3
and4
. Defaults to3
. - {[key: string]: string}
- A mapping of tags to assign to the resource.
- target
Resource stringLocation The location of the target resource.
This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
- target
Resource stringType The resource type (e.g.
Microsoft.Compute/virtualMachines
) of the target resource.This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
- window
Size string - The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than
frequency
. Possible values arePT1M
,PT5M
,PT15M
,PT30M
,PT1H
,PT6H
,PT12H
andP1D
. Defaults toPT5M
.
- actions
Sequence[Metric
Alert Action Args] - One or more
action
blocks as defined below. - application_
insights_ Metricweb_ test_ location_ availability_ criteria Alert Application Insights Web Test Location Availability Criteria Args A
application_insights_web_test_location_availability_criteria
block as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- auto_
mitigate bool - Should the alerts in this Metric Alert be auto resolved? Defaults to
true
. - criterias
Sequence[Metric
Alert Criteria Args] One or more (static)
criteria
blocks as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- description str
- The description of this Metric Alert.
- dynamic_
criteria MetricAlert Dynamic Criteria Args A
dynamic_criteria
block as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- enabled bool
- Should this Metric Alert be enabled? Defaults to
true
. - frequency str
- The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are
PT1M
,PT5M
,PT15M
,PT30M
andPT1H
. Defaults toPT1M
. - name str
- The name of the Metric Alert. Changing this forces a new resource to be created.
- resource_
group_ strname - The name of the resource group in which to create the Metric Alert instance. Changing this forces a new resource to be created.
- scopes Sequence[str]
- A set of strings of resource IDs at which the metric criteria should be applied.
- severity int
- The severity of this Metric Alert. Possible values are
0
,1
,2
,3
and4
. Defaults to3
. - Mapping[str, str]
- A mapping of tags to assign to the resource.
- target_
resource_ strlocation The location of the target resource.
This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
- target_
resource_ strtype The resource type (e.g.
Microsoft.Compute/virtualMachines
) of the target resource.This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
- window_
size str - The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than
frequency
. Possible values arePT1M
,PT5M
,PT15M
,PT30M
,PT1H
,PT6H
,PT12H
andP1D
. Defaults toPT5M
.
- actions List<Property Map>
- One or more
action
blocks as defined below. - Property Map
A
application_insights_web_test_location_availability_criteria
block as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- auto
Mitigate Boolean - Should the alerts in this Metric Alert be auto resolved? Defaults to
true
. - criterias List<Property Map>
One or more (static)
criteria
blocks as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- description String
- The description of this Metric Alert.
- dynamic
Criteria Property Map A
dynamic_criteria
block as defined below.NOTE One of either
criteria
,dynamic_criteria
orapplication_insights_web_test_location_availability_criteria
must be specified.- enabled Boolean
- Should this Metric Alert be enabled? Defaults to
true
. - frequency String
- The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are
PT1M
,PT5M
,PT15M
,PT30M
andPT1H
. Defaults toPT1M
. - name String
- The name of the Metric Alert. Changing this forces a new resource to be created.
- resource
Group StringName - The name of the resource group in which to create the Metric Alert instance. Changing this forces a new resource to be created.
- scopes List<String>
- A set of strings of resource IDs at which the metric criteria should be applied.
- severity Number
- The severity of this Metric Alert. Possible values are
0
,1
,2
,3
and4
. Defaults to3
. - Map<String>
- A mapping of tags to assign to the resource.
- target
Resource StringLocation The location of the target resource.
This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
- target
Resource StringType The resource type (e.g.
Microsoft.Compute/virtualMachines
) of the target resource.This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes.
- window
Size String - The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than
frequency
. Possible values arePT1M
,PT5M
,PT15M
,PT30M
,PT1H
,PT6H
,PT12H
andP1D
. Defaults toPT5M
.
Supporting Types
MetricAlertAction, MetricAlertActionArgs
- Action
Group stringId - The ID of the Action Group can be sourced from the
azure.monitoring.ActionGroup
resource - Webhook
Properties Dictionary<string, string> - The map of custom string properties to include with the post operation. These data are appended to the webhook payload.
- Action
Group stringId - The ID of the Action Group can be sourced from the
azure.monitoring.ActionGroup
resource - Webhook
Properties map[string]string - The map of custom string properties to include with the post operation. These data are appended to the webhook payload.
- action
Group StringId - The ID of the Action Group can be sourced from the
azure.monitoring.ActionGroup
resource - webhook
Properties Map<String,String> - The map of custom string properties to include with the post operation. These data are appended to the webhook payload.
- action
Group stringId - The ID of the Action Group can be sourced from the
azure.monitoring.ActionGroup
resource - webhook
Properties {[key: string]: string} - The map of custom string properties to include with the post operation. These data are appended to the webhook payload.
- action_
group_ strid - The ID of the Action Group can be sourced from the
azure.monitoring.ActionGroup
resource - webhook_
properties Mapping[str, str] - The map of custom string properties to include with the post operation. These data are appended to the webhook payload.
- action
Group StringId - The ID of the Action Group can be sourced from the
azure.monitoring.ActionGroup
resource - webhook
Properties Map<String> - The map of custom string properties to include with the post operation. These data are appended to the webhook payload.
MetricAlertApplicationInsightsWebTestLocationAvailabilityCriteria, MetricAlertApplicationInsightsWebTestLocationAvailabilityCriteriaArgs
- Component
Id string - The ID of the Application Insights Resource.
- Failed
Location intCount - The number of failed locations.
- Web
Test stringId - The ID of the Application Insights Web Test.
- Component
Id string - The ID of the Application Insights Resource.
- Failed
Location intCount - The number of failed locations.
- Web
Test stringId - The ID of the Application Insights Web Test.
- component
Id String - The ID of the Application Insights Resource.
- failed
Location IntegerCount - The number of failed locations.
- web
Test StringId - The ID of the Application Insights Web Test.
- component
Id string - The ID of the Application Insights Resource.
- failed
Location numberCount - The number of failed locations.
- web
Test stringId - The ID of the Application Insights Web Test.
- component_
id str - The ID of the Application Insights Resource.
- failed_
location_ intcount - The number of failed locations.
- web_
test_ strid - The ID of the Application Insights Web Test.
- component
Id String - The ID of the Application Insights Resource.
- failed
Location NumberCount - The number of failed locations.
- web
Test StringId - The ID of the Application Insights Web Test.
MetricAlertCriteria, MetricAlertCriteriaArgs
- Aggregation string
- The statistic that runs over the metric values. Possible values are
Average
,Count
,Minimum
,Maximum
andTotal
. - Metric
Name string - One of the metric names to be monitored.
- Metric
Namespace string - One of the metric namespaces to be monitored.
- Operator string
- The criteria operator. Possible values are
Equals
,GreaterThan
,GreaterThanOrEqual
,LessThan
andLessThanOrEqual
. - Threshold double
- The criteria threshold value that activates the alert.
- Dimensions
List<Metric
Alert Criteria Dimension> - One or more
dimension
blocks as defined below. - Skip
Metric boolValidation - Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted? Defaults to
false
.
- Aggregation string
- The statistic that runs over the metric values. Possible values are
Average
,Count
,Minimum
,Maximum
andTotal
. - Metric
Name string - One of the metric names to be monitored.
- Metric
Namespace string - One of the metric namespaces to be monitored.
- Operator string
- The criteria operator. Possible values are
Equals
,GreaterThan
,GreaterThanOrEqual
,LessThan
andLessThanOrEqual
. - Threshold float64
- The criteria threshold value that activates the alert.
- Dimensions
[]Metric
Alert Criteria Dimension - One or more
dimension
blocks as defined below. - Skip
Metric boolValidation - Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted? Defaults to
false
.
- aggregation String
- The statistic that runs over the metric values. Possible values are
Average
,Count
,Minimum
,Maximum
andTotal
. - metric
Name String - One of the metric names to be monitored.
- metric
Namespace String - One of the metric namespaces to be monitored.
- operator String
- The criteria operator. Possible values are
Equals
,GreaterThan
,GreaterThanOrEqual
,LessThan
andLessThanOrEqual
. - threshold Double
- The criteria threshold value that activates the alert.
- dimensions
List<Metric
Alert Criteria Dimension> - One or more
dimension
blocks as defined below. - skip
Metric BooleanValidation - Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted? Defaults to
false
.
- aggregation string
- The statistic that runs over the metric values. Possible values are
Average
,Count
,Minimum
,Maximum
andTotal
. - metric
Name string - One of the metric names to be monitored.
- metric
Namespace string - One of the metric namespaces to be monitored.
- operator string
- The criteria operator. Possible values are
Equals
,GreaterThan
,GreaterThanOrEqual
,LessThan
andLessThanOrEqual
. - threshold number
- The criteria threshold value that activates the alert.
- dimensions
Metric
Alert Criteria Dimension[] - One or more
dimension
blocks as defined below. - skip
Metric booleanValidation - Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted? Defaults to
false
.
- aggregation str
- The statistic that runs over the metric values. Possible values are
Average
,Count
,Minimum
,Maximum
andTotal
. - metric_
name str - One of the metric names to be monitored.
- metric_
namespace str - One of the metric namespaces to be monitored.
- operator str
- The criteria operator. Possible values are
Equals
,GreaterThan
,GreaterThanOrEqual
,LessThan
andLessThanOrEqual
. - threshold float
- The criteria threshold value that activates the alert.
- dimensions
Sequence[Metric
Alert Criteria Dimension] - One or more
dimension
blocks as defined below. - skip_
metric_ boolvalidation - Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted? Defaults to
false
.
- aggregation String
- The statistic that runs over the metric values. Possible values are
Average
,Count
,Minimum
,Maximum
andTotal
. - metric
Name String - One of the metric names to be monitored.
- metric
Namespace String - One of the metric namespaces to be monitored.
- operator String
- The criteria operator. Possible values are
Equals
,GreaterThan
,GreaterThanOrEqual
,LessThan
andLessThanOrEqual
. - threshold Number
- The criteria threshold value that activates the alert.
- dimensions List<Property Map>
- One or more
dimension
blocks as defined below. - skip
Metric BooleanValidation - Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted? Defaults to
false
.
MetricAlertCriteriaDimension, MetricAlertCriteriaDimensionArgs
MetricAlertDynamicCriteria, MetricAlertDynamicCriteriaArgs
- Aggregation string
- The statistic that runs over the metric values. Possible values are
Average
,Count
,Minimum
,Maximum
andTotal
. - Alert
Sensitivity string - The extent of deviation required to trigger an alert. Possible values are
Low
,Medium
andHigh
. - Metric
Name string - One of the metric names to be monitored.
- Metric
Namespace string - One of the metric namespaces to be monitored.
- Operator string
- The criteria operator. Possible values are
LessThan
,GreaterThan
andGreaterOrLessThan
. - Dimensions
List<Metric
Alert Dynamic Criteria Dimension> - One or more
dimension
blocks as defined below. - Evaluation
Failure intCount - The number of violations to trigger an alert. Should be smaller or equal to
evaluation_total_count
. Defaults to4
. - Evaluation
Total intCount - The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (
window_size
) and the selected number of aggregated points. Defaults to4
. - Ignore
Data stringBefore - The ISO8601 date from which to start learning the metric historical data and calculate the dynamic thresholds.
- Skip
Metric boolValidation - Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted?
- Aggregation string
- The statistic that runs over the metric values. Possible values are
Average
,Count
,Minimum
,Maximum
andTotal
. - Alert
Sensitivity string - The extent of deviation required to trigger an alert. Possible values are
Low
,Medium
andHigh
. - Metric
Name string - One of the metric names to be monitored.
- Metric
Namespace string - One of the metric namespaces to be monitored.
- Operator string
- The criteria operator. Possible values are
LessThan
,GreaterThan
andGreaterOrLessThan
. - Dimensions
[]Metric
Alert Dynamic Criteria Dimension - One or more
dimension
blocks as defined below. - Evaluation
Failure intCount - The number of violations to trigger an alert. Should be smaller or equal to
evaluation_total_count
. Defaults to4
. - Evaluation
Total intCount - The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (
window_size
) and the selected number of aggregated points. Defaults to4
. - Ignore
Data stringBefore - The ISO8601 date from which to start learning the metric historical data and calculate the dynamic thresholds.
- Skip
Metric boolValidation - Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted?
- aggregation String
- The statistic that runs over the metric values. Possible values are
Average
,Count
,Minimum
,Maximum
andTotal
. - alert
Sensitivity String - The extent of deviation required to trigger an alert. Possible values are
Low
,Medium
andHigh
. - metric
Name String - One of the metric names to be monitored.
- metric
Namespace String - One of the metric namespaces to be monitored.
- operator String
- The criteria operator. Possible values are
LessThan
,GreaterThan
andGreaterOrLessThan
. - dimensions
List<Metric
Alert Dynamic Criteria Dimension> - One or more
dimension
blocks as defined below. - evaluation
Failure IntegerCount - The number of violations to trigger an alert. Should be smaller or equal to
evaluation_total_count
. Defaults to4
. - evaluation
Total IntegerCount - The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (
window_size
) and the selected number of aggregated points. Defaults to4
. - ignore
Data StringBefore - The ISO8601 date from which to start learning the metric historical data and calculate the dynamic thresholds.
- skip
Metric BooleanValidation - Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted?
- aggregation string
- The statistic that runs over the metric values. Possible values are
Average
,Count
,Minimum
,Maximum
andTotal
. - alert
Sensitivity string - The extent of deviation required to trigger an alert. Possible values are
Low
,Medium
andHigh
. - metric
Name string - One of the metric names to be monitored.
- metric
Namespace string - One of the metric namespaces to be monitored.
- operator string
- The criteria operator. Possible values are
LessThan
,GreaterThan
andGreaterOrLessThan
. - dimensions
Metric
Alert Dynamic Criteria Dimension[] - One or more
dimension
blocks as defined below. - evaluation
Failure numberCount - The number of violations to trigger an alert. Should be smaller or equal to
evaluation_total_count
. Defaults to4
. - evaluation
Total numberCount - The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (
window_size
) and the selected number of aggregated points. Defaults to4
. - ignore
Data stringBefore - The ISO8601 date from which to start learning the metric historical data and calculate the dynamic thresholds.
- skip
Metric booleanValidation - Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted?
- aggregation str
- The statistic that runs over the metric values. Possible values are
Average
,Count
,Minimum
,Maximum
andTotal
. - alert_
sensitivity str - The extent of deviation required to trigger an alert. Possible values are
Low
,Medium
andHigh
. - metric_
name str - One of the metric names to be monitored.
- metric_
namespace str - One of the metric namespaces to be monitored.
- operator str
- The criteria operator. Possible values are
LessThan
,GreaterThan
andGreaterOrLessThan
. - dimensions
Sequence[Metric
Alert Dynamic Criteria Dimension] - One or more
dimension
blocks as defined below. - evaluation_
failure_ intcount - The number of violations to trigger an alert. Should be smaller or equal to
evaluation_total_count
. Defaults to4
. - evaluation_
total_ intcount - The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (
window_size
) and the selected number of aggregated points. Defaults to4
. - ignore_
data_ strbefore - The ISO8601 date from which to start learning the metric historical data and calculate the dynamic thresholds.
- skip_
metric_ boolvalidation - Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted?
- aggregation String
- The statistic that runs over the metric values. Possible values are
Average
,Count
,Minimum
,Maximum
andTotal
. - alert
Sensitivity String - The extent of deviation required to trigger an alert. Possible values are
Low
,Medium
andHigh
. - metric
Name String - One of the metric names to be monitored.
- metric
Namespace String - One of the metric namespaces to be monitored.
- operator String
- The criteria operator. Possible values are
LessThan
,GreaterThan
andGreaterOrLessThan
. - dimensions List<Property Map>
- One or more
dimension
blocks as defined below. - evaluation
Failure NumberCount - The number of violations to trigger an alert. Should be smaller or equal to
evaluation_total_count
. Defaults to4
. - evaluation
Total NumberCount - The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (
window_size
) and the selected number of aggregated points. Defaults to4
. - ignore
Data StringBefore - The ISO8601 date from which to start learning the metric historical data and calculate the dynamic thresholds.
- skip
Metric BooleanValidation - Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted?
MetricAlertDynamicCriteriaDimension, MetricAlertDynamicCriteriaDimensionArgs
Import
Metric Alerts can be imported using the resource id
, e.g.
$ pulumi import azure:monitoring/metricAlert:MetricAlert main /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-resources/providers/Microsoft.Insights/metricAlerts/example-metricalert
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.