All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azurenative.insights.MetricAlert Maven / Gradle / Ivy

There is a newer version: 2.82.0
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azurenative.insights;

import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.insights.MetricAlertArgs;
import com.pulumi.azurenative.insights.outputs.MetricAlertActionResponse;
import com.pulumi.azurenative.insights.outputs.MetricAlertMultipleResourceMultipleMetricCriteriaResponse;
import com.pulumi.azurenative.insights.outputs.MetricAlertSingleResourceMultipleMetricCriteriaResponse;
import com.pulumi.azurenative.insights.outputs.WebtestLocationAvailabilityCriteriaResponse;
import com.pulumi.core.Alias;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.Object;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * The metric alert resource.
 * Azure REST API version: 2018-03-01. Prior API version in Azure Native 1.x: 2018-03-01.
 * 
 * ## Example Usage
 * ### Create or update a dynamic alert rule for Multiple Resources
 * 
 * 
 * {@code
 * 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 com.pulumi.azurenative.insights.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 metricAlert = new MetricAlert("metricAlert", MetricAlertArgs.builder()
 *             .actions(MetricAlertActionArgs.builder()
 *                 .actionGroupId("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2")
 *                 .webHookProperties(Map.ofEntries(
 *                     Map.entry("key11", "value11"),
 *                     Map.entry("key12", "value12")
 *                 ))
 *                 .build())
 *             .autoMitigate(true)
 *             .criteria(MetricAlertMultipleResourceMultipleMetricCriteriaArgs.builder()
 *                 .allOf(DynamicMetricCriteriaArgs.builder()
 *                     .alertSensitivity("Medium")
 *                     .criterionType("DynamicThresholdCriterion")
 *                     .dimensions()
 *                     .failingPeriods(DynamicThresholdFailingPeriodsArgs.builder()
 *                         .minFailingPeriodsToAlert(4)
 *                         .numberOfEvaluationPeriods(4)
 *                         .build())
 *                     .metricName("Percentage CPU")
 *                     .metricNamespace("microsoft.compute/virtualmachines")
 *                     .name("High_CPU_80")
 *                     .operator("GreaterOrLessThan")
 *                     .timeAggregation("Average")
 *                     .build())
 *                 .odataType("Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria")
 *                 .build())
 *             .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());
 * 
 *     }
 * }
 * 
 * }
 * 
* ### Create or update a dynamic alert rule for Single Resource * *
 * {@code
 * 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 com.pulumi.azurenative.insights.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 metricAlert = new MetricAlert("metricAlert", MetricAlertArgs.builder()
 *             .actions(MetricAlertActionArgs.builder()
 *                 .actionGroupId("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2")
 *                 .webHookProperties(Map.ofEntries(
 *                     Map.entry("key11", "value11"),
 *                     Map.entry("key12", "value12")
 *                 ))
 *                 .build())
 *             .autoMitigate(true)
 *             .criteria(MetricAlertMultipleResourceMultipleMetricCriteriaArgs.builder()
 *                 .allOf(DynamicMetricCriteriaArgs.builder()
 *                     .alertSensitivity("Medium")
 *                     .criterionType("DynamicThresholdCriterion")
 *                     .dimensions()
 *                     .failingPeriods(DynamicThresholdFailingPeriodsArgs.builder()
 *                         .minFailingPeriodsToAlert(4)
 *                         .numberOfEvaluationPeriods(4)
 *                         .build())
 *                     .ignoreDataBefore("2019-04-04T21:00:00.000Z")
 *                     .metricName("Percentage CPU")
 *                     .metricNamespace("microsoft.compute/virtualmachines")
 *                     .name("High_CPU_80")
 *                     .operator("GreaterOrLessThan")
 *                     .timeAggregation("Average")
 *                     .build())
 *                 .odataType("Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria")
 *                 .build())
 *             .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());
 * 
 *     }
 * }
 * 
 * }
 * 
* ### Create or update a web test alert rule * *
 * {@code
 * 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(MetricAlertMultipleResourceMultipleMetricCriteriaArgs.builder()
 *                 .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")
 *                 .build())
 *             .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());
 * 
 *     }
 * }
 * 
 * }
 * 
* ### Create or update an alert rule for Multiple Resource * *
 * {@code
 * 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 com.pulumi.azurenative.insights.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 metricAlert = new MetricAlert("metricAlert", MetricAlertArgs.builder()
 *             .actions(MetricAlertActionArgs.builder()
 *                 .actionGroupId("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2")
 *                 .webHookProperties(Map.ofEntries(
 *                     Map.entry("key11", "value11"),
 *                     Map.entry("key12", "value12")
 *                 ))
 *                 .build())
 *             .autoMitigate(true)
 *             .criteria(MetricAlertMultipleResourceMultipleMetricCriteriaArgs.builder()
 *                 .allOf(DynamicMetricCriteriaArgs.builder()
 *                     .criterionType("StaticThresholdCriterion")
 *                     .dimensions()
 *                     .metricName("Percentage CPU")
 *                     .metricNamespace("microsoft.compute/virtualmachines")
 *                     .name("High_CPU_80")
 *                     .operator("GreaterThan")
 *                     .threshold(80.5)
 *                     .timeAggregation("Average")
 *                     .build())
 *                 .odataType("Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria")
 *                 .build())
 *             .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());
 * 
 *     }
 * }
 * 
 * }
 * 
* ### Create or update an alert rule for Single Resource * *
 * {@code
 * 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 com.pulumi.azurenative.insights.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 metricAlert = new MetricAlert("metricAlert", MetricAlertArgs.builder()
 *             .actions(MetricAlertActionArgs.builder()
 *                 .actionGroupId("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2")
 *                 .webHookProperties(Map.ofEntries(
 *                     Map.entry("key11", "value11"),
 *                     Map.entry("key12", "value12")
 *                 ))
 *                 .build())
 *             .autoMitigate(true)
 *             .criteria(MetricAlertMultipleResourceMultipleMetricCriteriaArgs.builder()
 *                 .allOf(DynamicMetricCriteriaArgs.builder()
 *                     .criterionType("StaticThresholdCriterion")
 *                     .dimensions()
 *                     .metricName("\\Processor(_Total)\\% Processor Time")
 *                     .name("High_CPU_80")
 *                     .operator("GreaterThan")
 *                     .threshold(80.5)
 *                     .timeAggregation("Average")
 *                     .build())
 *                 .odataType("Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria")
 *                 .build())
 *             .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());
 * 
 *     }
 * }
 * 
 * }
 * 
* ### Create or update an alert rule on Resource group(s) * *
 * {@code
 * 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 com.pulumi.azurenative.insights.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 metricAlert = new MetricAlert("metricAlert", MetricAlertArgs.builder()
 *             .actions(MetricAlertActionArgs.builder()
 *                 .actionGroupId("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2")
 *                 .webHookProperties(Map.ofEntries(
 *                     Map.entry("key11", "value11"),
 *                     Map.entry("key12", "value12")
 *                 ))
 *                 .build())
 *             .autoMitigate(true)
 *             .criteria(MetricAlertMultipleResourceMultipleMetricCriteriaArgs.builder()
 *                 .allOf(DynamicMetricCriteriaArgs.builder()
 *                     .criterionType("StaticThresholdCriterion")
 *                     .dimensions()
 *                     .metricName("Percentage CPU")
 *                     .metricNamespace("microsoft.compute/virtualmachines")
 *                     .name("High_CPU_80")
 *                     .operator("GreaterThan")
 *                     .threshold(80.5)
 *                     .timeAggregation("Average")
 *                     .build())
 *                 .odataType("Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria")
 *                 .build())
 *             .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());
 * 
 *     }
 * }
 * 
 * }
 * 
* ### Create or update an alert rule on Subscription * *
 * {@code
 * 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 com.pulumi.azurenative.insights.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 metricAlert = new MetricAlert("metricAlert", MetricAlertArgs.builder()
 *             .actions(MetricAlertActionArgs.builder()
 *                 .actionGroupId("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2")
 *                 .webHookProperties(Map.ofEntries(
 *                     Map.entry("key11", "value11"),
 *                     Map.entry("key12", "value12")
 *                 ))
 *                 .build())
 *             .autoMitigate(true)
 *             .criteria(MetricAlertMultipleResourceMultipleMetricCriteriaArgs.builder()
 *                 .allOf(DynamicMetricCriteriaArgs.builder()
 *                     .criterionType("StaticThresholdCriterion")
 *                     .dimensions()
 *                     .metricName("Percentage CPU")
 *                     .metricNamespace("microsoft.compute/virtualmachines")
 *                     .name("High_CPU_80")
 *                     .operator("GreaterThan")
 *                     .threshold(80.5)
 *                     .timeAggregation("Average")
 *                     .build())
 *                 .odataType("Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria")
 *                 .build())
 *             .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());
 * 
 *     }
 * }
 * 
 * }
 * 
* ### Create or update an alert rules with dimensions * *
 * {@code
 * 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 com.pulumi.azurenative.insights.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 metricAlert = new MetricAlert("metricAlert", MetricAlertArgs.builder()
 *             .actions(MetricAlertActionArgs.builder()
 *                 .actionGroupId("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2")
 *                 .webHookProperties(Map.ofEntries(
 *                     Map.entry("key11", "value11"),
 *                     Map.entry("key12", "value12")
 *                 ))
 *                 .build())
 *             .autoMitigate(true)
 *             .criteria(MetricAlertMultipleResourceMultipleMetricCriteriaArgs.builder()
 *                 .allOf(DynamicMetricCriteriaArgs.builder()
 *                     .criterionType("StaticThresholdCriterion")
 *                     .dimensions(                    
 *                         MetricDimensionArgs.builder()
 *                             .name("ActivityName")
 *                             .operator("Include")
 *                             .values("*")
 *                             .build(),
 *                         MetricDimensionArgs.builder()
 *                             .name("StatusCode")
 *                             .operator("Include")
 *                             .values("200")
 *                             .build())
 *                     .metricName("Availability")
 *                     .metricNamespace("Microsoft.KeyVault/vaults")
 *                     .name("Metric1")
 *                     .operator("GreaterThan")
 *                     .threshold(55)
 *                     .timeAggregation("Average")
 *                     .build())
 *                 .odataType("Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria")
 *                 .build())
 *             .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 * * An existing resource can be imported using its type token, name, and identifier, e.g. * * ```sh * $ pulumi import azure-native:insights:MetricAlert webtest-name-example /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName} * ``` * */ @ResourceType(type="azure-native:insights:MetricAlert") public class MetricAlert extends com.pulumi.resources.CustomResource { /** * the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. * */ @Export(name="actions", refs={List.class,MetricAlertActionResponse.class}, tree="[0,1]") private Output> actions; /** * @return the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. * */ public Output>> actions() { return Codegen.optional(this.actions); } /** * the flag that indicates whether the alert should be auto resolved or not. The default is true. * */ @Export(name="autoMitigate", refs={Boolean.class}, tree="[0]") private Output autoMitigate; /** * @return the flag that indicates whether the alert should be auto resolved or not. The default is true. * */ public Output> autoMitigate() { return Codegen.optional(this.autoMitigate); } /** * defines the specific alert criteria information. * */ @Export(name="criteria", refs={Object.class}, tree="[0]") private Output criteria; /** * @return defines the specific alert criteria information. * */ public Output criteria() { return this.criteria; } /** * the description of the metric alert that will be included in the alert email. * */ @Export(name="description", refs={String.class}, tree="[0]") private Output description; /** * @return the description of the metric alert that will be included in the alert email. * */ public Output> description() { return Codegen.optional(this.description); } /** * the flag that indicates whether the metric alert is enabled. * */ @Export(name="enabled", refs={Boolean.class}, tree="[0]") private Output enabled; /** * @return the flag that indicates whether the metric alert is enabled. * */ public Output enabled() { return this.enabled; } /** * how often the metric alert is evaluated represented in ISO 8601 duration format. * */ @Export(name="evaluationFrequency", refs={String.class}, tree="[0]") private Output evaluationFrequency; /** * @return how often the metric alert is evaluated represented in ISO 8601 duration format. * */ public Output evaluationFrequency() { return this.evaluationFrequency; } /** * the value indicating whether this alert rule is migrated. * */ @Export(name="isMigrated", refs={Boolean.class}, tree="[0]") private Output isMigrated; /** * @return the value indicating whether this alert rule is migrated. * */ public Output isMigrated() { return this.isMigrated; } /** * Last time the rule was updated in ISO8601 format. * */ @Export(name="lastUpdatedTime", refs={String.class}, tree="[0]") private Output lastUpdatedTime; /** * @return Last time the rule was updated in ISO8601 format. * */ public Output lastUpdatedTime() { return this.lastUpdatedTime; } /** * Resource location * */ @Export(name="location", refs={String.class}, tree="[0]") private Output location; /** * @return Resource location * */ public Output location() { return this.location; } /** * Azure resource name * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return Azure resource name * */ public Output name() { return this.name; } /** * the list of resource id's that this metric alert is scoped to. * */ @Export(name="scopes", refs={List.class,String.class}, tree="[0,1]") private Output> scopes; /** * @return the list of resource id's that this metric alert is scoped to. * */ public Output> scopes() { return this.scopes; } /** * Alert severity {0, 1, 2, 3, 4} * */ @Export(name="severity", refs={Integer.class}, tree="[0]") private Output severity; /** * @return Alert severity {0, 1, 2, 3, 4} * */ public Output severity() { return this.severity; } /** * Resource tags * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return Resource tags * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * 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. * */ @Export(name="targetResourceRegion", refs={String.class}, tree="[0]") private Output targetResourceRegion; /** * @return 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. * */ public Output> targetResourceRegion() { return Codegen.optional(this.targetResourceRegion); } /** * 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. * */ @Export(name="targetResourceType", refs={String.class}, tree="[0]") private Output targetResourceType; /** * @return 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. * */ public Output> targetResourceType() { return Codegen.optional(this.targetResourceType); } /** * Azure resource type * */ @Export(name="type", refs={String.class}, tree="[0]") private Output type; /** * @return Azure resource type * */ public Output type() { return this.type; } /** * the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. * */ @Export(name="windowSize", refs={String.class}, tree="[0]") private Output windowSize; /** * @return the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. * */ public Output windowSize() { return this.windowSize; } /** * * @param name The _unique_ name of the resulting resource. */ public MetricAlert(java.lang.String name) { this(name, MetricAlertArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public MetricAlert(java.lang.String name, MetricAlertArgs args) { this(name, args, null); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. * @param options A bag of options that control this resource's behavior. */ public MetricAlert(java.lang.String name, MetricAlertArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:insights:MetricAlert", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private MetricAlert(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:insights:MetricAlert", name, null, makeResourceOptions(options, id), false); } private static MetricAlertArgs makeArgs(MetricAlertArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? MetricAlertArgs.Empty : args; } private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() .version(Utilities.getVersion()) .aliases(List.of( Output.of(Alias.builder().type("azure-native:insights/v20180301:MetricAlert").build()) )) .build(); return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); } /** * Get an existing Host resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param options Optional settings to control the behavior of the CustomResource. */ public static MetricAlert get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new MetricAlert(name, id, options); } }