com.pulumi.azurenative.insights.AlertRule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-native Show documentation
Show all versions of azure-native Show documentation
A native Pulumi package for creating and managing Azure resources.
// *** 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.AlertRuleArgs;
import com.pulumi.azurenative.insights.outputs.LocationThresholdRuleConditionResponse;
import com.pulumi.azurenative.insights.outputs.ManagementEventRuleConditionResponse;
import com.pulumi.azurenative.insights.outputs.RuleEmailActionResponse;
import com.pulumi.azurenative.insights.outputs.RuleWebhookActionResponse;
import com.pulumi.azurenative.insights.outputs.ThresholdRuleConditionResponse;
import com.pulumi.core.Alias;
import com.pulumi.core.Either;
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.Object;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* The alert rule resource.
* Azure REST API version: 2016-03-01. Prior API version in Azure Native 1.x: 2016-03-01.
*
* ## Example Usage
* ### Create or update an alert rule
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.insights.AlertRule;
* import com.pulumi.azurenative.insights.AlertRuleArgs;
* 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 alertRule = new AlertRule("alertRule", AlertRuleArgs.builder()
* .actions()
* .condition(LocationThresholdRuleConditionArgs.builder()
* .dataSource(RuleManagementEventDataSourceArgs.builder()
* .metricName("Requests")
* .odataType("Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource")
* .resourceUri("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest")
* .build())
* .odataType("Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition")
* .operator("GreaterThan")
* .threshold(3)
* .timeAggregation("Total")
* .windowSize("PT5M")
* .build())
* .description("Pura Vida")
* .isEnabled(true)
* .location("West US")
* .name("chiricutin")
* .resourceGroupName("Rac46PostSwapRG")
* .ruleName("chiricutin")
* .tags()
* .build());
*
* }
* }
*
* }
*
*
* ## Import
*
* An existing resource can be imported using its type token, name, and identifier, e.g.
*
* ```sh
* $ pulumi import azure-native:insights:AlertRule chiricutin /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}
* ```
*
*/
@ResourceType(type="azure-native:insights:AlertRule")
public class AlertRule extends com.pulumi.resources.CustomResource {
/**
* action that is performed when the alert rule becomes active, and when an alert condition is resolved.
*
*/
@Export(name="action", refs={Either.class,RuleEmailActionResponse.class,RuleWebhookActionResponse.class}, tree="[0,1,2]")
private Output* @Nullable */ Either> action;
/**
* @return action that is performed when the alert rule becomes active, and when an alert condition is resolved.
*
*/
public Output>> action() {
return Codegen.optional(this.action);
}
/**
* 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,Either.class,RuleEmailActionResponse.class,RuleWebhookActionResponse.class}, tree="[0,[1,2,3]]")
private Output* @Nullable */ List>> 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 condition that results in the alert rule being activated.
*
*/
@Export(name="condition", refs={Object.class}, tree="[0]")
private Output
© 2015 - 2024 Weber Informatics LLC | Privacy Policy