DispatchRule

class DispatchRule : KotlinCustomResource

Provides a Application Real-Time Monitoring Service (ARMS) Alert Dispatch Rule resource. For information about Application Real-Time Monitoring Service (ARMS) Alert Dispatch Rule and how to use it, see What is Alert Dispatch_Rule.

NOTE: Available since v1.136.0.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.arms.AlertContact;
import com.pulumi.alicloud.arms.AlertContactArgs;
import com.pulumi.alicloud.arms.AlertContactGroup;
import com.pulumi.alicloud.arms.AlertContactGroupArgs;
import com.pulumi.alicloud.arms.DispatchRule;
import com.pulumi.alicloud.arms.DispatchRuleArgs;
import com.pulumi.alicloud.arms.inputs.DispatchRuleGroupRuleArgs;
import com.pulumi.alicloud.arms.inputs.DispatchRuleLabelMatchExpressionGridArgs;
import com.pulumi.alicloud.arms.inputs.DispatchRuleNotifyRuleArgs;
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 defaultAlertContact = new AlertContact("defaultAlertContact", AlertContactArgs.builder()
.alertContactName("example_value")
.email("example_value@aaa.com")
.build());
var defaultAlertContactGroup = new AlertContactGroup("defaultAlertContactGroup", AlertContactGroupArgs.builder()
.alertContactGroupName("example_value")
.contactIds(defaultAlertContact.id())
.build());
var defaultDispatchRule = new DispatchRule("defaultDispatchRule", DispatchRuleArgs.builder()
.dispatchRuleName("example_value")
.dispatchType("CREATE_ALERT")
.groupRules(DispatchRuleGroupRuleArgs.builder()
.groupWaitTime(5)
.groupInterval(15)
.repeatInterval(100)
.groupingFields("alertname")
.build())
.labelMatchExpressionGrids(DispatchRuleLabelMatchExpressionGridArgs.builder()
.labelMatchExpressionGroups(DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupArgs.builder()
.labelMatchExpressions(DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupLabelMatchExpressionArgs.builder()
.key("_aliyun_arms_involvedObject_kind")
.value("app")
.operator("eq")
.build())
.build())
.build())
.notifyRules(DispatchRuleNotifyRuleArgs.builder()
.notifyObjects(
DispatchRuleNotifyRuleNotifyObjectArgs.builder()
.notifyObjectId(defaultAlertContact.id())
.notifyType("ARMS_CONTACT")
.name("example_value")
.build(),
DispatchRuleNotifyRuleNotifyObjectArgs.builder()
.notifyObjectId(defaultAlertContactGroup.id())
.notifyType("ARMS_CONTACT_GROUP")
.name("example_value")
.build())
.notifyChannels(
"dingTalk",
"wechat")
.build())
.build());
}
}

Import

Application Real-Time Monitoring Service (ARMS) Alert Contact can be imported using the id, e.g.

$ pulumi import alicloud:arms/dispatchRule:DispatchRule example <id>

Properties

Link copied to clipboard

The name of the dispatch policy.

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

The alert handling method. Valid values: CREATE_ALERT: generates an alert. DISCARD_ALERT: discards the alert event and generates no alert.

Link copied to clipboard

Sets the event group. See group_rules below. It will be ignored when dispatch_type = "DISCARD_ALERT".

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val isRecover: Output<Boolean>?

Specifies whether to send the restored alert. Valid values: true: sends the alert. false: does not send the alert.

Link copied to clipboard

Sets the dispatch rule. See label_match_expression_grid below.

Link copied to clipboard

Sets the notification rule. See notify_rules below. It will be ignored when dispatch_type = "DISCARD_ALERT".

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val status: Output<String>

The resource status of Alert Dispatch Rule.

Link copied to clipboard
val urn: Output<String>